Macro function index#
An index of every macro function, sorted by group. Use Ctrl+F to search by function name, or open
the page of each group for descriptions and examples.
Most page functions also take frameSearch/frameSearchType to target an iframe, and
EvalScript returns its result wrapped in an object. Read Iframes, selectors and waiting for elements
before you use them.
Macros run in 9Hits campaigns, 9Login scripts and Studio, but a few functions behave differently in 9Hits campaigns. Those functions have an icon right after their name; hover over the icon to see what it means:
| Icon | Meaning |
|---|---|
Does not run in 9Hits campaigns: the function is blocked and returns {error: "Blocked"}. Use it only in 9Login scripts and when testing in Studio. |
|
Has no effect in 9Hits campaigns: you can still call the function but it does nothing; for example, Log does not print anywhere. |
|
| Works differently in 9Hits campaigns: the result differs from what you get in 9Login or Studio; see the function's description. |
Functions by group#
| Group | Functions |
|---|---|
| Utilities | 21 |
| Browser and navigation | 21 |
| DOM and JavaScript execution | 13 |
| Clicks and mouse | 24 |
| Keyboard and input | 5 |
| Screenshots | 3 |
| Files and processes | 15 |
| CAPTCHA and AI | 14 |
All functions in alphabetical order#
| Function | Parameters | Group |
|---|---|---|
AesDecryptEx |
data, key, options |
Utilities |
AesEncryptEx |
data, key, options |
Utilities |
Base64Decode |
encodedText, returnAsText=true |
Utilities |
Base64Encode |
input |
Utilities |
Delay |
ms1, ms2 |
Utilities |
Exit |
- | Utilities |
GenerateXpath |
tag, attr, value, index |
Utilities |
GetAppVersion |
- | Utilities |
GetProfileInfo |
- | Utilities |
HttpRequest |
url, data, timeout=0, headers=null, returnAsBuffer=false, bypassProxy=true |
Utilities |
Log |
msg1, msg2, ... |
Utilities |
Md5 |
input |
Utilities |
Random |
value1, value2 |
Utilities |
RandomArray |
array |
Utilities |
RandomFloat |
min, max |
Utilities |
RandomInt |
value1, value2 |
Utilities |
Sha1 |
input |
Utilities |
Sha224 |
input |
Utilities |
Sha256 |
input |
Utilities |
Sha384 |
input |
Utilities |
Sha512 |
input |
Utilities |
CloseTab |
target="" |
Browser and navigation |
GetBrowserSize |
- | Browser and navigation |
GetHtml |
frameSearch="", frameSearchType="" |
Browser and navigation |
GetTabs |
- | Browser and navigation |
GetUrl |
- | Browser and navigation |
GetUserAgent |
- | Browser and navigation |
GetWindowSize |
- | Browser and navigation |
IsHideBrowser |
- | Browser and navigation |
IsLoading |
- | Browser and navigation |
IsMobile |
- | Browser and navigation |
MoveTo |
x, y |
Browser and navigation |
Navigate |
url, referrer |
Browser and navigation |
NewTab |
url="", focus=true |
Browser and navigation |
ResizeTo |
width, height |
Browser and navigation |
ScrollTo |
X, Y, smooth=false |
Browser and navigation |
TabCount |
- | Browser and navigation |
TabFocus |
query |
Browser and navigation |
WaitForDownload |
timeout=60 |
Browser and navigation |
WaitForLoading |
timeout=0 |
Browser and navigation |
WaitForRequest |
match, timeout=30 |
Browser and navigation |
WaitForResponse |
match, timeout=30, withBody=false |
Browser and navigation |
EvalScript |
js, frameSearch, frameSearchType |
DOM and JavaScript execution |
EvalScriptWithPromise |
js, frameSearch, frameSearchType |
DOM and JavaScript execution |
GetElementPos |
jsCode, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
GetElementPosBySelector |
selector, frameSearch="", frameSearchType="", skipZeroOffset=true |
DOM and JavaScript execution |
SetAttrBySelector |
selector, attr, value, index, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetByClass |
className, attr, value, index, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetById |
id, attr, value, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetByName |
name, attr, value, index, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetByTag |
tagName, attr, value, index, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetByXpath |
xpath, attr, value, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
SetFilesToElement |
selector, files, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
WaitForElmtBySelector |
selector, state, timeout=60, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
WaitForElmtByXpath |
xpath, state, timeout=60, frameSearch="", frameSearchType="" |
DOM and JavaScript execution |
ClickByClass |
className, index=0, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickByCoordinates |
X1, Y1, X2, Y2, clickCount=1, modifiers=0, button="left" |
Clicks and mouse |
ClickByCustomJS |
jsCode, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickById |
id, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickByName |
name, index=0, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickBySelector |
selector, index=0, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickByTag |
tag, index=0, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickByXpath |
xpath, clickCount=1, frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickRandomExternalLink |
frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickRandomInternalLink |
frameSearch="", frameSearchType="" |
Clicks and mouse |
ClickRandomLink |
type="any", frameSearch="", frameSearchType="" |
Clicks and mouse |
DragMouse |
from, to, speed=0.5, button="left", modifiers=0 |
Clicks and mouse |
MoveMouse |
startPoint, endPoint, modifiers=0, button="none" |
Clicks and mouse |
MoveMouseToAnyWhere |
modifiers=0, button="none" |
Clicks and mouse |
MoveMouseToArea |
X1, Y1, X2, Y2, modifiers=0, button="none" |
Clicks and mouse |
MoveMouseToElmByCustomJS |
jsCode, frameSearch="", frameSearchType="", modifiers=0, button="none" |
Clicks and mouse |
MoveMouseToElmBySelector |
selector, index=0, frameSearch="", frameSearchType="", modifiers=0, button="none" |
Clicks and mouse |
MoveMouseToElmByXpath |
xpath, frameSearch="", frameSearchType="", modifiers=0, button="none" |
Clicks and mouse |
SendMouseClick |
x, y, button="left", repeat=1, modifiers=0 |
Clicks and mouse |
SendMouseDown |
x, y, button="left", modifiers=0 |
Clicks and mouse |
SendMouseMove |
x, y, modifiers=0, button="none" |
Clicks and mouse |
SendMouseUp |
x=-1, y=-1, modifiers=0 |
Clicks and mouse |
SendMouseWheel |
deltaX, deltaY, modifiers=0, button="left" |
Clicks and mouse |
SendTouch |
points, repeat=1, modifiers=0 |
Clicks and mouse |
SendKeyChar |
character, modifiers=0 |
Keyboard and input |
SendKeyDown |
keyCode, modifiers=0 |
Keyboard and input |
SendKeyPress |
keyCode, modifiers=0 |
Keyboard and input |
SendKeyUp |
keyCode, modifiers=0 |
Keyboard and input |
Typing |
text, speed1=0, speed2=0 |
Keyboard and input |
CaptureArea |
x1, y1, x2, y2, quality=80 |
Screenshots |
CaptureElement |
selector, quality=80, frameSearch="", frameSearchType="" |
Screenshots |
CapturePage |
quality=80 |
Screenshots |
CopyFileOrDir |
src, dst |
Files and processes |
DelFileOrDir |
path |
Files and processes |
GetCurrentDir |
- | Files and processes |
GetDownloadDir |
- | Files and processes |
GetFileInfo |
path |
Files and processes |
GetHomeDir |
- | Files and processes |
LaunchProcess |
cmd, args, wait=false |
Files and processes |
MkDir |
path |
Files and processes |
MoveFileOrDir |
src, dst |
Files and processes |
PathExists |
path |
Files and processes |
ReadDir |
path |
Files and processes |
ReadFileAsBytes |
path |
Files and processes |
ReadFileAsString |
path |
Files and processes |
TouchFile |
path |
Files and processes |
WriteFile |
path, data |
Files and processes |
ACReportIncorrectImage |
clientKey, taskId |
CAPTCHA and AI |
ACReportIncorrectRecaptcha |
clientKey, taskId |
CAPTCHA and AI |
ACSolve |
params, timeout |
CAPTCHA and AI |
AZReportBad |
key, captchaId |
CAPTCHA and AI |
AZSolve |
params, timeout |
CAPTCHA and AI |
GenImageAI |
options |
CAPTCHA and AI |
ListAIModels |
options |
CAPTCHA and AI |
PromptAI |
options |
CAPTCHA and AI |
SolveImageCaptcha |
imgSelector, resultSelector, service, apiKey, timeout=300, overrideApiServer=null |
CAPTCHA and AI |
SolveRecaptcha |
service, apiKey, timeout=300, overrideApiServer=null |
CAPTCHA and AI |
SolvehCaptcha |
service, apiKey, timeout=300, overrideApiServer=null |
CAPTCHA and AI |
TryToCallRecaptchaCallBack |
response, frameSearch="", frameSearchType="" |
CAPTCHA and AI |
_2CaptchaReportBad |
key, captchaId |
CAPTCHA and AI |
_2CaptchaSolve |
params, timeout |
CAPTCHA and AI |
Related constants#
Keyboard functions and the modifiers parameter use constants such as K_ENTER, K_TAB, WITH_CTRL,
WITH_SHIFT. The full list is in Key constants.