Launch imacros from terminal using imacros://run/?m=
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Launch imacros from terminal using imacros://run/?m=
Hi,
Currently im using iMacros 10.0.2.1450 + Firefox 61.0.1 + Ubuntu 16.0.4
I have been trying to run the macro with the browser launch from the terminal along by using "imacros://run/?m=Open6Tabs.iim" or "imacros://Demo-Firefox/run/?m=Open6Tabs.iim" but it does not run the macro after the browser is launched.
it was working great until iMacros 8.9.7 + Firefox 55.0.3, is there a different syntax to load the macro from bookmarks in latest imacros for firefox quantum?
I cannot afford to downgrade to older firefox version so would really appreciate if someone could provide solution for this for quantum firefox. Thank you
Currently im using iMacros 10.0.2.1450 + Firefox 61.0.1 + Ubuntu 16.0.4
I have been trying to run the macro with the browser launch from the terminal along by using "imacros://run/?m=Open6Tabs.iim" or "imacros://Demo-Firefox/run/?m=Open6Tabs.iim" but it does not run the macro after the browser is launched.
it was working great until iMacros 8.9.7 + Firefox 55.0.3, is there a different syntax to load the macro from bookmarks in latest imacros for firefox quantum?
I cannot afford to downgrade to older firefox version so would really appreciate if someone could provide solution for this for quantum firefox. Thank you
Re: Launch imacros from terminal using imacros://run/?m=
Yep, the 'imacros://run/?m=' Syntax is not supported anymore in iMacros for FF v10.0.2 (not sure either if it was still working in v9.0.3 btw), and you get some Browser Runtime Error about "the 'imacros' Protocol not being associated with any Application..." I think I remember from some mini-Test during the v10.0.2 Beta-Testing Phase...groundfalling wrote:Hi,
Currently im usingCode: Select all
iMacros 10.0.2.1450 + Firefox 61.0.1 + Ubuntu 16.0.4
I have been trying to run the macro with the browser launch from the terminal along by using "imacros://run/?m=Open6Tabs.iim" or "imacros://Demo-Firefox/run/?m=Open6Tabs.iim" but it does not run the macro after the browser is launched.
it was working great until iMacros 8.9.7 + Firefox 55.0.3, is there a different syntax to load the macro from bookmarks in latest imacros for firefox quantum?
I cannot afford to downgrade to older firefox version so would really appreciate if someone could provide solution for this for quantum firefox. Thank you
The only (a bit cumbersome) Workaround I know of is to embed your Macro as Base64 Encoded Bookmark Macro or on-the-fly String Macro in your own '.html' Page...
Documented in the Wiki: Command Line Support
If "maintaining" a "parallel" Installation with, say, (Portable) FF55 or FF56 (+ iMacros for FF v8.9.7) is not an Option for you, you could have a look at FF Forked Browsers like Pale Moon / Waterfox / Cyberfox / etc on which v8.9.7 or v8.8.7 will still work...
(I use for myself Pale Moon v26.3.3 (=FF47) + iMacros for FF v8.8.2 (+ Win10_x64).)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Launch imacros from terminal using imacros://run/?m=
Hum..., or another "Idea" would be to launch your Macro from an OS-Level Macro with 'AHK' or 'AutoIt' or some equivalent Tool on Ubuntu...
(But that's still "a bit" cumbersome, ah-ah...! )
(But that's still "a bit" cumbersome, ah-ah...! )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
Thank you for your response chivracq,
i was able to run the below code in htm file through terminal, which meant that it is loading the imacros with the browser.
But im still confused about how to embed this below macro demo code in the above HTM file so it could run with the launch. Would really appreciate the help. Thank you
i was able to run the below code in htm file through terminal, which meant that it is loading the imacros with the browser.
Code: Select all
<html>
<body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">
<script>
var macroCode = '';
macroCode += 'PROMPT HELLO!\n';
macroCode += 'URL GOTO=http://imacros.net/\n';
macroCode += 'PROMPT BYE!\n';
function launchMacro()
{
try
{
if(!/^(?:chrome|https?|file)/.test(location))
{
alert('iMacros: Open webpage to run a macro.');
return;
}
var macro = {};
macro.source = macroCode;
macro.name = 'EmbeddedMacro';
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
window.dispatchEvent(evt);
}
catch(e)
{
alert('iMacros Bookmarklet error: '+e.toString());
};
}
</script>
<a id="criimlaunch" href="javascript:launchMacro();">Launch iMacros</a>
</body>
</html>
Code: Select all
VERSION BUILD=7500718 RECORDER=FX
TAB T=1
URL GOTO=http://demo.imacros.net/Automate/Eval
'Wait a random number (1 to 5) of seconds
SET !VAR1 EVAL("Math.floor(Math.random()*5 + 1);")
WAIT SECONDS={{!VAR1}}
SET !EXTRACT_TEST_POPUP NO
'Extract the date
TAG POS=1 TYPE=B ATTR=TXT:* EXTRACT=TXT
'Check if time deviates more than 20 hours. If yes, stop macro with an error
SET !VAR2 EVAL("var n_hours = 20, ms_in_hour = 60*60*1000, s=\"{{!EXTRACT}}\", now = new Date(); var deviation = now.getTime()-Date.parse(s); if (deviation > n_hours*ms_in_hour) MacroError(\"Time deviates more than 20 hours\");")
'Clean the !EXTRACT variable for the next task
SET !EXTRACT NULL
'Extract the number in the input box
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=NAME:textfield EXTRACT=TXT
'Check if extracted number (still a string, has to be parsed into a float!) lies between 99 and 101.
'Stop macro with an error if not.
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\", d = parseFloat(s); if(d > 99 && d < 101) d; else MacroError(\"Value is not in the set range\")")
Re: Launch imacros from terminal using imacros://run/?m=
Yeah..., hum-hum..., I've never "experimented" with "it" either, but I think it will work for "short and simple" Macros, but will quickly become a bit of a "pain in the ass" with a bit more complex Macros, especially with 'EVAL()' Statements indeed, as you'll have to "take care" and to single/double/triple escape all Special Characters like Single + Double Quotes + Escape Char etc... and + the Single Quote for '.iim' Comments as well, ah-ah...!groundfalling wrote:Thank you for your response chivracq,
i was able to run the below code in htm file through terminal, which meant that it is loading the imacros with the browser.But im still confused about how to embed this below macro demo code in the above HTM file so it could run with the launch. Would really appreciate the help. Thank youCode: Select all
<html> <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);"> <script> var macroCode = ''; macroCode += 'PROMPT HELLO!\n'; macroCode += 'URL GOTO=http://imacros.net/\n'; macroCode += 'PROMPT BYE!\n'; function launchMacro() { try { if(!/^(?:chrome|https?|file)/.test(location)) { alert('iMacros: Open webpage to run a macro.'); return; } var macro = {}; macro.source = macroCode; macro.name = 'EmbeddedMacro'; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent('iMacrosRunMacro', true, true, macro); window.dispatchEvent(evt); } catch(e) { alert('iMacros Bookmarklet error: '+e.toString()); }; } </script> <a id="criimlaunch" href="javascript:launchMacro();">Launch iMacros</a> </body> </html>
Code: Select all
VERSION BUILD=7500718 RECORDER=FX TAB T=1 URL GOTO=http://demo.imacros.net/Automate/Eval 'Wait a random number (1 to 5) of seconds SET !VAR1 EVAL("Math.floor(Math.random()*5 + 1);") WAIT SECONDS={{!VAR1}} SET !EXTRACT_TEST_POPUP NO 'Extract the date TAG POS=1 TYPE=B ATTR=TXT:* EXTRACT=TXT 'Check if time deviates more than 20 hours. If yes, stop macro with an error SET !VAR2 EVAL("var n_hours = 20, ms_in_hour = 60*60*1000, s=\"{{!EXTRACT}}\", now = new Date(); var deviation = now.getTime()-Date.parse(s); if (deviation > n_hours*ms_in_hour) MacroError(\"Time deviates more than 20 hours\");") 'Clean the !EXTRACT variable for the next task SET !EXTRACT NULL 'Extract the number in the input box TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=NAME:textfield EXTRACT=TXT 'Check if extracted number (still a string, has to be parsed into a float!) lies between 99 and 101. 'Stop macro with an error if not. SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\", d = parseFloat(s); if(d > 99 && d < 101) d; else MacroError(\"Value is not in the set range\")")
It might be easier in that case if you let iMacros do the "Conversion" itself by using Base64 Bookmark Macros, I would think... Not very practical if you need to regularly edit the Macro, but at least you won't have to worry about converting your Macro...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
how about running this simple below code from the HTM file?
Code: Select all
SET !VAR1 1
'Start at TAB T=2, as we do not want to change "start" tab of user
'Open TAB, select it, load website
TAB OPEN NEW
ADD !VAR1 1
TAB T={{!VAR1}}
URL GOTO=http://www.iopus.com
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
just asking if it has to be converted to a JS first and than added between the <script></script>
Re: Launch imacros from terminal using imacros://run/?m=
groundfalling wrote:how about running this simple below code from the HTM file?Code: Select all
SET !VAR1 1 'Start at TAB T=2, as we do not want to change "start" tab of user 'Open TAB, select it, load website TAB OPEN NEW ADD !VAR1 1 TAB T={{!VAR1}} URL GOTO=http://www.iopus.com
Hum, OK..., and... any Progress..., 12h later...?groundfalling wrote:just asking if it has to be converted to a JS first and than added between the <script></script>
I told you I never "experimented" with those Methods/Techniques (as I never needed them for myself), so..., did you try...?, did you make any Progress...? (Not difficult to test by yourself I would think...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
The most important part is the frustration and disappointment which comes with the new imacros version 10.0.2.1450, when you launch the browser through terminal the addon itself fails and disappears most of the time, as if it was never installed and you have have to reinstall it which kills the whole purpose of using it auto through bash or terminal.
Don't know if it is firefox quantum issue or the bug is in the addon itself that it just disappears when the browser launches and the times when it is still there and it manages to run the HTM file than it has so many restrictions. I dont mind paying for the license to remove the restrictions but if the addon will not even install properly and wont load through terminal than no point using it.
Don't know if it is firefox quantum issue or the bug is in the addon itself that it just disappears when the browser launches and the times when it is still there and it manages to run the HTM file than it has so many restrictions. I dont mind paying for the license to remove the restrictions but if the addon will not even install properly and wont load through terminal than no point using it.
Re: Launch imacros from terminal using imacros://run/?m=
"The most important part is the frustration and disappointment which comes with the new imacros version 10.0.2.1450..."groundfalling wrote:The most important part is the frustration and disappointment which comes with the new imacros version 10.0.2.1450, when you launch the browser through terminal the addon itself fails and disappears most of the time, as if it was never installed and you have have to reinstall it which kills the whole purpose of using it auto through bash or terminal.
Don't know if it is firefox quantum issue or the bug is in the addon itself that it just disappears when the browser launches and the times when it is still there and it manages to run the HTM file than it has so many restrictions. I dont mind paying for the license to remove the restrictions but if the addon will not even install properly and wont load through terminal than no point using it.
=> Yeah, well, I can definitely relate..., v10.0.2 in my Opinion is OK for mini-simplistic Macros only using a few "Standard" Commands...
I was "involved" during the Beta-Testing Phase...., which lasted about 6-8 weeks, with 4 or 5 different Builds I think..., I spent most of the time "fighting" for each time 1-2-3 completely blocking parts (in my Opinion), in the end after those 6-8 weeks, I maybe managed to test (hum..., is a big word) max 10% or 20% of all the Functionality that I use myself.., and suddenly some "next day", v10.0.2 was already officially released and pushed to all Users who had Automatic Updates ON..., tja...!
(But it was the very first time some iMacros Version had a Beta-Testing Phase before the Official Release... (I've been asking for several years...!), then I guess we should already be Happy..., next time [even] better then...! )
Worth reading the Beta-Testing Thread maybe..., is a bit long, 6 Pages I think, and I can sometimes be a bit "Verbose" (in my "Analytical Thinking"), and I think I acted a few times like a "perfect Drama Queen", oops-ah-ah...! , but was for "the Good Cause", ah-ah...!, I (already) knew I wouldn't be using that Version for myself..., but hum..., worth reading though I think... And maybe if a few other "Advanced" Users had participated during the Beta-Testing Phase, but I was the only-only-only one, maybe the "Final Result" could have been a bit different/better..., dunno...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
Been seeing you active on this forum for years so i always assumed that you were a part imacros.net team, didn't know that you were only a user yourself. The problem is that Firefox non-quantum versions are getting obsolete and many websites are putting restrictions to update the browser in order to access some of the features. so i have no choice but to use the latest Firefox version therefore stuck with this good for nothing imacros 10. but again i dont mind paying them for license as long as the new version is fully compatible with quantum Firefox and does not crash or disable or uninstall just with the browser launch.
Re: Launch imacros from terminal using imacros://run/?m=
Yeah well, "part of the imacros.net team"... (hum, like that, sounds nice, ah-ah...! ), but hum..., yeah, a mini-little bit indeed, became Mod 2 or 3 years ago, but my only "Purpose" is to prevent Spam on the Forum, you can check the Spam-Stats in this Post, ah-ah...!, but further than that, I'm still just a "normal" User, a bit "Creative"/"Advanced" ah-ah...! I don't even have a License for all the 'PE' Versions, and I've never used iMB even, ah-ah...!groundfalling wrote:Been seeing you active on this forum for years so i always assumed that you were a part imacros.net team, didn't know that you were only a user yourself. The problem is that Firefox non-quantum versions are getting obsolete and many websites are putting restrictions to update the browser in order to access some of the features. so i have no choice but to use the latest Firefox version therefore stuck with this good for nothing imacros 10. but again i dont mind paying them for license as long as the new version is fully compatible with quantum Firefox and does not crash or disable or uninstall just with the browser launch.
(Like I already mentioned, I still use v8.8.2 for FF for myself..., oops...!)
I would think/hope, some v10.0.3 Version for FF will come some time..., hopefully with some shortened Beta-Testing Phase, not sure though, I guess they (Tech/Dev) found me a bit "annoying" ah-ah...!
=> Did you read the Beta-Testing Thread btw....? Any feedback...? (Can't post in the Thread itself, is locked now..., here is OK... )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
so i was able to find a workaround in case the pre-installed imacros 10 addon crash or disable or uninstall at the time of browser launch.
Download the imacros xpi rename it to and copy it to the firefox profile "extensions" folder (which can be done by a one line code) and than when you launch the profile from terminal or script, the addon will surely be there and it will run the HTM file at the browser launch. BUT the only annoying thing is the PLAY dialog prompt which imacros 10.0.2.1450 shows and requires you to uncheck the "show this dialog next time" which again involves the manual click for the first time. Is there any way to disable this dialog box without modifying the addon files?
Download the imacros xpi
Code: Select all
imacros_for_firefox-10.0.2.1450-an+fx-linux.xpi
Code: Select all
{81BF1D23-5F17-408D-AC6B-BD6DF7CAF670}.xpi
Re: Launch imacros from terminal using imacros://run/?m=
Hum, strange about the '.xpi' File disappearing I guess, and needing to be installed/copied again...groundfalling wrote:so i was able to find a workaround in case the pre-installed imacros 10 addon crash or disable or uninstall at the time of browser launch.
Download the imacros xpirename it toCode: Select all
imacros_for_firefox-10.0.2.1450-an+fx-linux.xpi
and copy it to the firefox profile "extensions" folder (which can be done by a one line code) and than when you launch the profile from terminal or script, the addon will surely be there and it will run the HTM file at the browser launch. BUT the only annoying thing is the PLAY dialog prompt which imacros 10.0.2.1450 shows and requires you to uncheck the "show this dialog next time" which again involves the manual click for the first time. Is there any way to disable this dialog box without modifying the addon files?Code: Select all
{81BF1D23-5F17-408D-AC6B-BD6DF7CAF670}.xpi
But the 'PLAY' Dialog is I guess the same you get like from the 'Click me to play' Link in my Quote in this Thread/Post (which doesn't work in v10.0.2, you then get the "Protocol" Error) and for which you had indeed, the first time you ran it, to "approve" the Execution... But I think that DialogBox was coming from the Browser itself, and not from iMacros, and some Security Exception would then be added/stored if I remember correctly to/in some Setting in 'about:config'..., this one I guess: 'extensions.imacros.white-list' (for v8.8.2, not sure at all it will exist as well for v10.0.2 in FF62, the "Mechanism" might now be different...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 46
- Joined: Tue Jul 01, 2014 1:26 pm
Re: Launch imacros from terminal using imacros://run/?m=
found a workaround clicking the dialog box to uncheck and click 'play' using
next issue is finding a solution for 50 lines limit in the macro code. could you suggest anything?
Code: Select all
xdotool