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

Script location


A script's source code can optionally be located in a local file or URL. This is known as the script's location.

Upon execution, the script is read directly from its location, so any changes made to the file or URL up to that point will take effect.
This allows you, for example, to keep your scripts in your hard drive and edit them with any external code editor or IDE instead of using AutoControl's integrated code editor.
Also, when a script has a location, any function that takes as argument an absolute path or URL can also accept a relative path or URL. Among those functions are ACtl.include, ACtl.import, ACtl.getFile, ACtl.saveFile and a few others.
For example, in the case shown in the image above, the script's source code is located in C:\Projects\Test\script.js.
So, inside that script we can call ACtl.getFile('data.json', 'json') to load the file C:\Projects\Test\data.json.
Additionally, the script location can contain placeholders such as <desktop>, <documents> and others. For example:

Then, the relative path passed to the ACtl.getFile function will translate to <desktop>\MyScripts\data_folder\data.json
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