TAB
(LinkToClipboard)From iMacros
Sets focus on the tab with number n.
Contents |
Syntax

TAB (T=n|OPEN|CLOSE|CLOSEALLOTHER)
Parameters
- T
- Specifies the tab number. Other than a number, the following commands are possible:
- CLOSE
- Closes the current tab.
- OPEN
- Opens a new tab in the background.
- CLOSEALLOTHERS
- Closes all tabs except the one currently in focus.
- NEW
- Required with OPEN to open a new tab within a macro see below
Examples
Related example macros: Demo-Tab See examples.
If you want to open a second website, use the following code:
' open a webpage in the first tab URL GOTO=http://www.iopus.com ' open a new tab TAB OPEN ' get new tab to foreground TAB T=2 ' load another page URL GOTO=http://www.google.com ' close the second tab TAB CLOSE TAB T=1
Note
With the current version of iMacros for Firefox (6.0.0.6) to open a new tab with a macro the command TAB NEW OPEN should be used.
iMacros for Firefox has a slightly different behavior when it comes to counting tabs: In the iMacros Browser the tab number is always counted from the first tab. But in iMacros for Firefox the tab positions are relative to the start position. If you start the macro while the 5th tab is open, then the 5th tab is addressed with TAB T=1 and TAB T=2 refers to the next tab (= 6th tab).
iMacros for Internet Explorer supports only TAB T=1 and TAB T=2. Please note that you can run all IE related web testing in the iMacros Browser, as it is 100% IE compatible.
