How do I execute JavaScript from an iMacro script?
URL GOTO=javascript:alert("TEST");
The Javascript works fine when pasting it into the address bar (by putting "javascript:
" in front of the code) but unfortunately iMacros does not recognize this as a valid URL.
So since this doesn't work, what's the correct way to run JavaScript from an iMacro script?
How do I execute JavaScript from an iMacro script?
URL GOTO=javascript:alert("TEST");
The Javascript works fine when pasting it into the address bar (by putting "javascript:
" in front of the code) but unfortunately iMacros does not recognize this as a valid URL.
So since this doesn't work, what's the correct way to run JavaScript from an iMacro script?
Share Improve this question edited Mar 5, 2015 at 17:47 George Stocker 57.9k29 gold badges181 silver badges238 bronze badges asked Mar 5, 2015 at 17:39 MeowlsMeowls 591 gold badge1 silver badge5 bronze badges 02 Answers
Reset to default 4Try something without a dialog. For example: URL GOTO=javascript:console.log("TEST");
or URL GOTO=javascript:function<SP>test(){status="TEST"};void<SP>test();
make a separate java-script file and then call it from your macro using
URL GOTO=imacros://run/?m=your-javascript.js
note that this method is not actually perfect cause imacros does not support calling javascript files from within macros, so this is a workaround and may have certain side effects - enterprise imacros support callback for javascript files.