AutoControl Control your browser your way Forum               Install now from theChrome Web Store

GUI vs API


Most actions available in AutoControl's graphical interface have an equivalent in the scripting API as shown in the following table.
API function GUI actions
ACtl.setTabState Activate tabs
Switch to ...
Select tabs
Pin tabs
Mute tabs
Focus
Minimize
Maximize
Restore
Fullscreen
Hide
Stay on top
ACtl.openURL Open URL Open new tab Open in incognito
ACtl.closeTab Close tabs Close window
ACtl.setClipboard Clipbrd put
ACtl.runCommand Open file/program
ACtl.switchState Set switch state
ACtl.STOP_CHAIN
ACtl.STOP_FULL_SEQ
CONTINUE CHAIN IF
ACtl.on
ACtl.sleep
Wait
ACtl.execAction Go back
Go forward
Reload tabs
Unload tabs
Go upper URL
Zoom in
Zoom out
Duplicate tabs
Detach tabs
Send to bottom
Clipbrd cut
Clipbrd copy
Clipbrd paste
Copy links
Extract URLs
Erase dup. lines
Reopen closed tab

Actions that are not in the above table, such as Move tabs, Move/Resize or Scroll, don't have a direct equivalent in the scripting API, but can be triggered indirectly using the ACtl.execAction function. Let's see an example:
Suppose we wanted to perform the "scroll down" action from a script. Since there's no ACtl function for that action, we can create it in the GUI and then call it programmatically, as follows:

And now we can trigger that action from a script, like this:

	//Scroll down the current window one notch
	await ACtl.execAction('Scroll down', '#currentTab') ;
	
Scripting API Script Isolation Asynchronicity Backgrnd Scripts GUI vs API ACtl.include ACtl.import ACtl.getFile ACtl.saveFile ACtl.saveURL ACtl.openURL ACtl.closeTab ACtl.runInTab ACtl.runInFrames ACtl.runInPageCtx ACtl.getTabInfo ACtl.getTabIds ACtl.TAB_ID ACtl.setTabState ACtl.captureTab ACtl.execAction ACtl.runCommand ACtl.getClipboard ACtl.setClipboard ACtl.expand ACtl.switchState ACtl.var ACtl.pubVar ACtl.on ACtl.off ACtl.sleep ACtl.STOP_CHAIN ACtl.STOP_FULL_SEQ