How to run a macro from the command line using Chrome

Discussions and Tech Support specific to the iMacros for Chrome extension.
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
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Mon Jan 15, 2018 7:46 pm

sanfric wrote:Hi
With Firefox, I use this procedure which works very well

Code: Select all

RetVal = Shell("C:\program files\Firefox\firefox.exe imacros://run/?m=TP.iim")
I followed Tom's procedure to do the same thing with Chrome

Code: Select all

RetVal = Shell("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe file:/// C:\Users\...\Documents\iMacros\Macros/TPS.htm")
Here is the TPS file. htm

Code: Select all

html>
     <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

        <script>
           var e_m64 = " VkVSU0lPTiUyMEJVSUxEJTNEMTAwMSUyMFJFQ09SREVSJTNEQ1IlMEFVUkwlMjBHT1RPJTNEaHR0cCUzQSUyRiUyRmNvcnJlc3BvbmRhbnRzLmxldGVsZWdyYW1tZS5mciUyRldEMTYwQVdQJTJGV0QxNjBBd3AuZXhlJTJGQ09OTkVDVCUyRnBvcnRhaWxfY29yciUzRl9XV1JFRkVSRVJfJTNEJTI2X1dXTkFUSU9OXyUzRDUlMEFUQUclMjBQT1MlM0QxJTIwVFlQRSUzRElNRyUyMEFUVFIlM0RJRCUzQUEyJTBBVEFHJTIwUE9TJTNEMSUyMFRZUEUlM0RTRUxFQ1QlMjBGT1JNJTNETkFNRSUzQVBBR0VfQVJUSUNMRVNfTk9VVkVBVV9URVhURSUyMEFUVFIlM0RJRCUzQUExJTIwQ09OVEVOVCUzRCUyNTM=";
        </script>

 
</script> 

        <a id="criimlaunch" href="javascript:(function() {try{if(!/^(?:chrome|https?|file)/.test(location)){alert('iMacros: Open webpage to run a macro.');return;}var macro = {};macro.source = decodeURIComponent(atob(e_m64));macro.name = 'MacroBookmarklet';var evt = document.createEvent('CustomEvent');evt.initCustomEvent('iMacrosRunMacro', true, true, macro);window.dispatchEvent(evt);}catch(e){alert('iMacros Bookmarklet error: '+e.toString());}}) ();">Launch CR iMacros</a>

     </body>

<
</script> 

 </html>
It works but there are two tabs opened: an useless "TPS.htm" tab with "Lauch Cr iMacros" an after the web page defined in the instructions of the script.

How to have only the web page without the TPS.htm tab ? Or close immédiately this tab?

thank you in advance for your help.
Sanfric
FCIM...! :mrgreen: (Read my Sig...)

Simply use a:

Code: Select all

TAB CLOSEALLOTHERS
in your '.iim' Script if you don't mind closing all "other" Tabs, or a:

Code: Select all

TAB T=0
TAB CLOSE
if you only want to close the "previous" Tab, I would think...
You might need '!ERRORIGNORE' for the Script to pass Parsing-Validation as I think there is a Check there for 'TAB T>0', but Negative Tab_Nbs do work, at least in iMacros for FF until at least v8.9.7, I reckon it will work in iMacros for CR as well, v8.4.4 or v10.0.

Hum, and mini-Detail, you have a "dangerous" or at least unneeded Space in "file:/// C:\Users\..."... :idea:
- (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...
sanfric
Posts: 35
Joined: Mon Dec 07, 2009 4:33 pm

Re: How to run a macro from the command line using Chrome

Post by sanfric » Thu Jan 18, 2018 12:39 pm

Hi,
Thank you for your help. The result is achieved. It's more clean!
Now, I'm looking for Chrome something equivalent to this code used with Firefox

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=NAME:PAGE_ARTICLES_NOUVEAU_TEXTE ATTR=ID:A7 CONTENT={{!clipboard}}
That allows me to paste in the web page I opened the contents of the clipboard from a Winword file .. I read that this procedure did not work with Chrome.

What can I do , in Chrome, for the same result as the Firefox code.

Thank for your answer

sanfric
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Thu Jan 18, 2018 12:53 pm

sanfric wrote:Hi,
Thank you for your help. The result is achieved. It's more clean!
Now, I'm looking for Chrome something equivalent to this code used with Firefox

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=NAME:PAGE_ARTICLES_NOUVEAU_TEXTE ATTR=ID:A7 CONTENT={{!clipboard}}
That allows me to paste in the web page I opened the contents of the clipboard from a Winword file .. I read that this procedure did not work with Chrome.

What can I do , in Chrome, for the same result as the Firefox code.

Thank for your answer

sanfric
Yep, I have another Workaround for '{{!CLIPBOARD}}' on CR..., hum... maybe 2, hum 4 now, ah-ah...!, well, depending on your FCI... :roll:
=> Grrr...!, but FCIM again, sorry... Is it so complicated to mention 3 Versions about your Config...?
- (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...
sanfric
Posts: 35
Joined: Mon Dec 07, 2009 4:33 pm

Re: How to run a macro from the command line using Chrome

Post by sanfric » Thu Jan 18, 2018 4:24 pm

For Chivracq

I do not understand exactly what you are asking to me. May be my configuration?

Version 1709 (16229.192) Windows 10 Pro French

Chrome: Version 63.0.3239.132 (Official Build) (64-bit)

iMacros for Chrome: BUILD VERSION = 1001 RECORDER = CR


Sanfric
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Thu Jan 18, 2018 8:43 pm

sanfric wrote:For Chivracq

I do not understand exactly what you are asking to me. May be my configuration?

Code: Select all

Version 1709 (16229.192) Windows 10 Pro French

Chrome: Version 63.0.3239.132 (Official Build) (64-bit)

iMacros for Chrome: BUILD VERSION = 1001 RECORDER = CR
Sanfric
Yep, the 'C' in "FCI" stands for "Configuration", like explained in my Sig that I asked you to read... And if you registered in 2009, you should have had the time by now to read the Forum Rules for Required Info to include in your Posts when you start a Thread or post for the first time in some existing Thread, I would think... :roll:

So OK..., you are on iMacros for CR v10.0.1 + CR63, that means you can use the 'EVENT' Mode for a 'Ctrl^v' (= Clipboard 'Paste'), which is the easiest Workaround for pasting the Content of your OS Clipboard on CR as '{{!CLIPBOARD}}' is surprisingly not supported on CR.

Other possible Workarounds I would have in mind would be to use your 'Winword' Doc as a DataSource for iMacros if you convert it to a '.CSV' or '.TXT' File, or even open it from a 2nd Tab in your Browser as '.TXT' or '.HTML' File... ('.CSV' Files are often a bit "problematic" to open this way, as the '.CSV' File Extension is often associated to Excel which will then go "fighting" with the Browser on who is going to handle that File, at least on FF last time I had done some Testing with it...), and I wouldn't be very surprised if you even could open "Word" Docs directly from your Browser..., I've never tried...
Depending on if you "only" use the Free-Free Add-on for CR, v10.0.1 is now limited in Functionality and File Access is not supported anymore in the Free Version, then the '!DATASOURCE' Solutions wouldn't work.

Another possibility would be to convert your Word Doc to a GoogleDoc Doc that you then as well can open and extract or edit directly from your Script in a 2nd Tab. GoogleDocs work actually best on CR, the Integration is "smoother" than with other Browsers supported by iMacros...
- (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...
sanfric
Posts: 35
Joined: Mon Dec 07, 2009 4:33 pm

Re: How to run a macro from the command line using Chrome

Post by sanfric » Wed Jan 24, 2018 1:23 pm

Hi,
I tried several syntax from the wiki iMacros.I am not a developer: I can not find the correct syntax for Event
I can paste only the letter "V" with this code

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR="HTML" CHAR="v" MODIFIERS="ctrl"
I see that MODIFIERS work only with Firefox but not with Chrome

What can I do for pasting the clipboard with CTRL+V with Chrome

Tnahks for your hlep
Sanfric
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Wed Jan 24, 2018 3:52 pm

sanfric wrote:Hi,
I tried several syntax from the wiki iMacros.I am not a developer: I can not find the correct syntax for Event
I can paste only the letter "V" with this code

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR="HTML" CHAR="v" MODIFIERS="ctrl"
I see that MODIFIERS work only with Firefox but not with Chrome

What can I do for pasting the clipboard with CTRL+V with Chrome

Tnahks for your hlep
Sanfric
Arrggghhh...!!, oh yep-yep, you're right...!, grrr..., I forgot about the 'MODIFIERS' Parameter not being supported on CR, as I only use FF myself...

OK-OK-OK..., then..., pfff..., you'll have to go back to one of the other Alternatives I mentioned then, ah-ah...!

But hum..., stg to "investigate" then..., is that the iMacros for FF Add-on is coded in pure JavaScript, meaning the whole 'EVENT' Mode/Functionality must be achievable in pure JavaScript, with and without the 'Modifiers' Functionality, maybe other Advanced User @iimfun will know how if he notices this Thread, and/or you might want to check on the SOF Forum how accessing the OS Clipboard and/or triggering a 'Ctrl^v' can be done in pure JS, then you can probably apply that Syntax in iMacros using the 'URL GOTO=javascript' Syntax...
- (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...
destatez
Posts: 9
Joined: Wed May 28, 2014 5:19 pm

Re: How to run a macro from the command line using Chrome

Post by destatez » Fri Nov 30, 2018 1:35 am

I'm sorry, but I'm lost in space. I'm a SW developer and have played around with HTML, but I could find none of the "solutions" given above that would do the trick. Some were dependent on earlier posts and it was really difficult (impossible) to come up with a solution that would work. I'm running 64-bit Windows 10. I have the Chrome imacros extension configured to look at files. I have created no bookmarks to iim related files. I've put an example iim file below. I have over 200 of these that merely change the URL. If I have to my batch script can copy a generated iim file into a pre-defined iim file in a pre-defined folder. The bat file examples of starting Chrome pointing to a disc file are straightforward. What I am not sure of, for starters, is what this file is that I'm asking chrome to open. It would seem that it's an HTML file, but there are so many variations above that I'm not sure where to go. Most seem to have some un-intelligible codes that were somehow obtained from Chrome. Can someone provide a workable HTML file example, identify where the imacros commands are that are somehow embedded in it, or where that HTML points to an actual iim file. If there are some "magic" numbers from Chrome, can you rehearse how to get those and where they go in the HTML?

I'd sure appreciate this with over 200 of these files/web pages to run against.

Dave

Code: Select all

VERSION BUILD=1005 RECORDER=CR
URL GOTO=https://live.door43.org/u/Steve_HamNC/th_2ch_text_ulb/596c04362f/
TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=ID:print-button
wait SECONDS=5
SET !TIMEOUT_MACRO 15 
TAB T=2
SAVEAS TYPE=HTM FOLDER=C:\\Users\\DES\\Documents\\MSData\\WA\\IT_Tasks\\Renderings_of_Repos\\USFM_Downloads FILE=th_2ch_text_ulb.htm
TAB T=1
TAB CLOSEALLOTHERS
tusiromania
Posts: 27
Joined: Tue Feb 04, 2020 11:09 pm

Re: How to run a macro from the command line using Chrome

Post by tusiromania » Sat Oct 08, 2022 5:22 pm

I found this solution to open from a batch file the chrome browser and run the Imacros .iim file.

https://wiki.imacros.net/Webextensions ... e_Support

I need help on 2 things

How I need to write the EVAL inside the script, because now I Have an error.

Code: Select all

macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';

How can I make LOOP working for the .csv file.
now is running 1 time only, don't loop the csv.

Code: Select all

atch file the chrome browser and run the Imacros .iim file.

https://wiki.imacros.net/Webextensions#Command_Line_Support

I need help on 2 things

How I need to write the EVAL inside the script, because now I Have an error.
macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';
How can I make LOOP working for the .csv file.
now is running 1 time only, don't loop the csv.

<html>
   <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

<script>
         var macroCode = '';
         
         macroCode += 'PROMPT HELLO!\n';
          
         macroCode += 'SET !EXTRACT_TEST_POPUP NO\n';
macroCode += 'SET !TIMEOUT_STEP 1\n';
macroCode += 'SET !ERRORIGNORE YES\n';
macroCode += 'SET !DATASOURCE artists.csv\n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += 'Set numeartist {{!COL1}}\n';
macroCode += '\n';
macroCode += ' \n';
macroCode += '\n';
macroCode += 'URL GOTO=https://open.spotify.com/search/{{numeartist}}/artists\n';
macroCode += 'wait seconds=3\n';
macroCode += 'TAG POS=1 TYPE=A ATTR=TXT:{{numeartist}} EXTRACT=HREF\n';
macroCode += 'TAG POS=1 TYPE=A ATTR=TXT:{{numeartist}} EXTRACT=TXT\n';
macroCode += '\n';
macroCode += 'wait seconds=1\n';
macroCode += 'ADD {{!EXTRACT}} {{!COL1}}\n';
macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';
macroCode += ' SAVEAS TYPE=EXTRACT FOLDER=* FILE=verificare-nume-artisti2\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>
I am using (FCI): iMacros for CR v10.1.1 'PE', CR v105.0.5195.102 (_x64), Win10_x64. ('CR' = 'Chrome' / 'PE' = 'Personal Edition')
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Sun Oct 09, 2022 1:19 pm

tusiromania wrote:
Sat Oct 08, 2022 5:22 pm
I found this solution to open from a batch file the chrome browser and run the Imacros .iim file.

https://wiki.imacros.net/Webextensions ... e_Support

I need help on 2 things

How I need to write the EVAL inside the script, because now I Have an error.

Code: Select all

macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';
How can I make LOOP working for the .csv file.
now is running 1 time only, don't loop the csv.

Code: Select all

<html>
   <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

<script>
         var macroCode = '';
         
         macroCode += 'PROMPT HELLO!\n';
          
         macroCode += 'SET !EXTRACT_TEST_POPUP NO\n';
macroCode += 'SET !TIMEOUT_STEP 1\n';
macroCode += 'SET !ERRORIGNORE YES\n';
macroCode += 'SET !DATASOURCE artists.csv\n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += ' \n';
macroCode += 'Set numeartist {{!COL1}}\n';
macroCode += '\n';
macroCode += ' \n';
macroCode += '\n';
macroCode += 'URL GOTO=https://open.spotify.com/search/{{numeartist}}/artists\n';
macroCode += 'wait seconds=3\n';
macroCode += 'TAG POS=1 TYPE=A ATTR=TXT:{{numeartist}} EXTRACT=HREF\n';
macroCode += 'TAG POS=1 TYPE=A ATTR=TXT:{{numeartist}} EXTRACT=TXT\n';
macroCode += '\n';
macroCode += 'wait seconds=1\n';
macroCode += 'ADD {{!EXTRACT}} {{!COL1}}\n';
macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';
macroCode += ' SAVEAS TYPE=EXTRACT FOLDER=* FILE=verificare-nume-artisti2\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>
I am using (FCI): iMacros for CR v10.1.1 'PE', CR v105.0.5195.102 (_x64), Win10_x64. ('CR' = 'Chrome' / 'PE' = 'Personal Edition')
How I need to write the EVAL inside the script, because now I Have an error.

Code: Select all

macroCode += 'SET !EXTRACT EVAL(\"'{{!EXTRACT}}'.replace(/\\\\n/g, '').trim();\")\n';

Hum, maybe "handy" if you posted the Error... :idea:
But try this one:

Code: Select all

macroCode += 'SET !EXTRACT EVAL("'{{!EXTRACT}}'.split('\\\\').join('').trim();")\n';
... Might need to try also with '\\\' and '\\\\\' in the `split()`, I'm not sure if x4 is correct...

Hum, and if you don't have any single '\' in the '!EXTRACT', then '\\' would/should also work...

For the Looping part, I'm "not sure", I would need to "think", and I see you've opened a separate Thread for this part, => I'll probably post in the "other" Thread if I come up with some Info...
- (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...
tusiromania
Posts: 27
Joined: Tue Feb 04, 2020 11:09 pm

Re: How to run a macro from the command line using Chrome

Post by tusiromania » Mon Oct 10, 2022 10:32 am

Hi @chivracq

I found a solution for LOOPS, I made this because of DataSource
if no datasource can work with SET !LOOP -20 only.

Code: Select all


SET !LOOP -20
SET MyLoop {{!LOOP}}
ADD MyLoop 21
SET !DATASOURCE_LINE {{MyLoop}}

About EVAL error, I cannot see, because the iMacros is not launched from the script.
I will test your sugesttion and coming back ..
but meanwhile a better solution for me is to Embed the iMacros bookmarklet in a local web page and no headeack with EVAL :)

Code: Select all

<html>
     <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

        <script>
           var e_m64 = "UFJPTVBUJTIwSEVMTE8hJTBBVVJMJTIwR09UTyUzRGh0dHAlM0ElMkYlMkZpbWFjcm9zLm5ldCUyRiUwQVBST01QVCUyMEJZRSE";
        </script>

        <a id="criimlaunch" href="javascript:(function() {try{if(!/^(?:chrome|https?|file)/.test(location)){alert('iMacros: Open webpage to run a macro.');return;}
           var macro = {};macro.source = decodeURIComponent(atob(e_m64));macro.name = 'MacroBookmarklet';
           var evt = document.createEvent('CustomEvent');evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
           window.dispatchEvent(evt);}catch(e){alert('iMacros Bookmarklet error: '+e.toString());}}) ();">Launch iMacros</a>

     </body>
 </html>

FCI:

Code: Select all


iMacros for CR v10.1.1 'PE', CR v105.0.5195.102 (_x64), Win10_x64. ('CR' = 'Chrome' / 'PE' = 'Personal Edition')

thank you
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to run a macro from the command line using Chrome

Post by chivracq » Mon Oct 10, 2022 11:08 am

tusiromania wrote:
Mon Oct 10, 2022 10:32 am
Hi @chivracq

I found a solution for LOOPS, I made this because of DataSource
if no datasource can work with SET !LOOP -20 only.

Code: Select all

SET !LOOP -20
SET MyLoop {{!LOOP}}
ADD MyLoop 21
SET !DATASOURCE_LINE {{MyLoop}}
About EVAL error, I cannot see, because the iMacros is not launched from the script.
I will test your sugesttion and coming back ..
but meanwhile a better solution for me is to Embed the iMacros bookmarklet in a local web page and no headeack with EVAL :)

Code: Select all

<html>
     <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">

        <script>
           var e_m64 = "UFJPTVBUJTIwSEVMTE8hJTBBVVJMJTIwR09UTyUzRGh0dHAlM0ElMkYlMkZpbWFjcm9zLm5ldCUyRiUwQVBST01QVCUyMEJZRSE";
        </script>

        <a id="criimlaunch" href="javascript:(function() {try{if(!/^(?:chrome|https?|file)/.test(location)){alert('iMacros: Open webpage to run a macro.');return;}
           var macro = {};macro.source = decodeURIComponent(atob(e_m64));macro.name = 'MacroBookmarklet';
           var evt = document.createEvent('CustomEvent');evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
           window.dispatchEvent(evt);}catch(e){alert('iMacros Bookmarklet error: '+e.toString());}}) ();">Launch iMacros</a>

     </body>
 </html>

FCI:

Code: Select all

iMacros for CR v10.1.1 'PE', CR v105.0.5195.102 (_x64), Win10_x64. ('CR' = 'Chrome' / 'PE' = 'Personal Edition')
thank you

OK, very "good" about finding about Negative `!LOOP`, I wouldn't have told you as I don't "advertize" about it :P , because it is a "Trick" and is based on a Bug, and I'm actually nearly surprised it still works in v10.1.x for CR, or even in any v10.x Versions for CR/FF. :o
@Dev were "supposed" to "fix it" and to prevent its Use for v10.x for CR/FF, + I suppose it allows to bypass the Max=100 Loops Limit for the 'PE' Versions... :twisted:

>>>

And yep-yep, embedding your ('.iim') Macro as a 'Base64' Object in the Page is a good Workaround, as it takes care of escaping Special Chars like '\' which is the Escape Char itself... 8)

Only "Drawbacks" are:
- If you need to modify/maintain that '.iim' Macro, then you first need to edit it in the Editor and to recompile it to 'Base64' every time, which is not "very practical", I would think... :(
- And you (might?) get some Warning/Popup from the Browser to click/allow manually to execute the embedded Script so that might also not be very practical if you try to run your Script unattended... (But maybe it's possible to disable those Security Warnings, I'm not sure...) :(
- (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...
Post Reply