Call Imacros from JS Under FireFox
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
Call Imacros from JS Under FireFox
Is it possible to call iimPlay from Javascript running in Firefox? I can make this work in IE by creating an activexobject("imacros") object, but is there any way to call the methods in the extension from a standalone javascript under FireFox?
I'd like to be able to generate the scripts on the fly and have the user execute them in firefox.
I'd like to be able to generate the scripts on the fly and have the user execute them in firefox.
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Hi,
Just to clarify: You do not mean the Javascript Scripting Interface inside iMacros (like in the "Si-Run-Test.js" example) but you want to trigger iMacros directly from Javascript that is embedded in your website?
In this case I recommend that you use http://run.imacros.net/?code=YOURCODEHERE
(Example imacros here)
You can generate the YOURCODEHERE string on-the-fly using (for example) Javascript, PHP, ASP or ASP.NET. The string (macro) is Base64 encoded. You can find function snippets for standard BASE64 encoding in any programming language on the web. Here is the code that is used in iMacros itself:
Base64 Encoder
Base64 Decoder (used inside iMacros to convert the YOURCODEHERE string back to a macro)
Both functions use:
You can also test the base64 encoding and decoding with an online service .
Just to clarify: You do not mean the Javascript Scripting Interface inside iMacros (like in the "Si-Run-Test.js" example) but you want to trigger iMacros directly from Javascript that is embedded in your website?
In this case I recommend that you use http://run.imacros.net/?code=YOURCODEHERE
(Example imacros here)
You can generate the YOURCODEHERE string on-the-fly using (for example) Javascript, PHP, ASP or ASP.NET. The string (macro) is Base64 encoded. You can find function snippets for standard BASE64 encoding in any programming language on the web. Here is the code that is used in iMacros itself:
Base64 Encoder
Code: Select all
function encodeBase64(str){
setBase64Str(str);
var result = '';
var inBuffer = new Array(3);
var lineCount = 0;
var done = false;
while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){
inBuffer[1] = readBase64();
inBuffer[2] = readBase64();
result += (base64Chars[ inBuffer[0] >> 2 ]);
if (inBuffer[1] != END_OF_INPUT){
result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
if (inBuffer[2] != END_OF_INPUT){
result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
result += (base64Chars [inBuffer[2] & 0x3F]);
} else {
result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
result += ('=');
done = true;
}
} else {
result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
result += ('=');
result += ('=');
done = true;
}
lineCount += 4;
}
}
return result;
}
Code: Select all
function decodeBase64(str){
setBase64Str(str);
var result = "";
var inBuffer = new Array(4);
var done = false;
while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT
&& (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){
inBuffer[2] = readReverseBase64();
inBuffer[3] = readReverseBase64();
result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));
if (inBuffer[2] != END_OF_INPUT){
result += ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));
if (inBuffer[3] != END_OF_INPUT){
result += ntos((((inBuffer[2] << 6) & 0xff) | inBuffer[3]));
} else {
done = true;
}
} else {
done = true;
}
}
return result;
}
Code: Select all
function readReverseBase64(){
if (!base64Str) return END_OF_INPUT;
while (true){
if (base64Count >= base64Str.length) return END_OF_INPUT;
var nextCharacter = base64Str.charAt(base64Count);
base64Count++;
if (reverseBase64Chars[nextCharacter]){
return reverseBase64Chars[nextCharacter];
}
if (nextCharacter == 'A') return 0;
}
return END_OF_INPUT;
}
Last edited by Tech Support on Tue Nov 13, 2007 11:27 pm, edited 1 time in total.
Hi guys -
I am trying to use this feature. I am successfully base 64 encoding my command string, and I used the website you pointed us to in order to test to make sure that an independent base 64 decoder can read my string.
When I enter the URL into my browser, it just sits there forever.
Here's the string, it's just a simple URL goto on iopus's page. I was't sure whether I needed to proceed my string with CODE so here it is
without CODE:
http://run.imacros.net/?code=VVJMIEdPVE ... Zvcm0uYXNw
and with CODE:
http://run.imacros.net/?code=Q09ERTpVUk ... 9ybS5hc3A=
Any thoughts? I appreciate any help you can offer.
I am trying to use this feature. I am successfully base 64 encoding my command string, and I used the website you pointed us to in order to test to make sure that an independent base 64 decoder can read my string.
When I enter the URL into my browser, it just sits there forever.
Here's the string, it's just a simple URL goto on iopus's page. I was't sure whether I needed to proceed my string with CODE so here it is
without CODE:
http://run.imacros.net/?code=VVJMIEdPVE ... Zvcm0uYXNw
and with CODE:
http://run.imacros.net/?code=Q09ERTpVUk ... 9ybS5hc3A=
Any thoughts? I appreciate any help you can offer.
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Your macro ("Without CODE:" version) runs well when I click on it:
http://run.imacros.net/?code=VVJMIEdPVE ... Zvcm0uYXNw
Are you using Firefox 3 Beta already? The run.imacros.net feature does not work in this version yet (we are working in it).
http://run.imacros.net/?code=VVJMIEdPVE ... Zvcm0uYXNw
Are you using Firefox 3 Beta already? The run.imacros.net feature does not work in this version yet (we are working in it).
Re: Call Imacros from JS Under FireFox
I want to use this method to put my script into a webpage but i have to get first some values from a form that is in the same webpage, how i can wet it?
-
- Posts: 1
- Joined: Wed Jul 07, 2010 6:17 pm
Re: Call Imacros from JS Under FireFox
I have a online application where sometimes I want the user to automatically upload a file in a predefined location. The perfect way would be to somehow run a macro with Javascript coming from my app (makes only sense), but that seems impossible.
The next best thing is the run.imacros.net website (why can imacros.net run a macro like that, but not me??). The macro should be triggered when the user logs in. My application uses events, one of which is the login event. When a few parameters are present, the macro should run, so I redirect the user/page/browser to the run.imacros.net website. When I get there, it says:
"You tried to run an embedded iMacros script but the iMacros Firefox Add-on is not installed yet. Please install the free, open source iMacros Firefox extension to run the shared browser scripts:"
Then, if I copy the URL in the addressbar and paste it into a new tab, it works perfectly (although it asks if it should run the macro, which is annoying (can you "trust" a website or something??))!
How come Firefox (or run.imacros.net) thinks the addon isn't installed? It is!
Thanks a whole bunch!
Btw the URL with macro is http://run.imacros.net/?code=VVJMIEdPVE ... 9ORFM9Mw== (for now just a redirect back to my app + a wait)
The next best thing is the run.imacros.net website (why can imacros.net run a macro like that, but not me??). The macro should be triggered when the user logs in. My application uses events, one of which is the login event. When a few parameters are present, the macro should run, so I redirect the user/page/browser to the run.imacros.net website. When I get there, it says:
"You tried to run an embedded iMacros script but the iMacros Firefox Add-on is not installed yet. Please install the free, open source iMacros Firefox extension to run the shared browser scripts:"
Then, if I copy the URL in the addressbar and paste it into a new tab, it works perfectly (although it asks if it should run the macro, which is annoying (can you "trust" a website or something??))!
How come Firefox (or run.imacros.net) thinks the addon isn't installed? It is!
Thanks a whole bunch!
Btw the URL with macro is http://run.imacros.net/?code=VVJMIEdPVE ... 9ORFM9Mw== (for now just a redirect back to my app + a wait)
-
- Posts: 6
- Joined: Fri Jan 21, 2011 10:20 am
Re: Call Imacros from JS Under FireFox
This feature is great. For my purposes though it's got one nasty problem. Part of my macros include passwords that I don't want to be sending externally, no matter how safe the service is. Is there any way of doing this without using the http://run.imacros.net/?code= service?
Re: Call Imacros from JS Under FireFox
Well. they could use the events system for the activation of macros inside web pages...
Re: Call Imacros from JS Under FireFox
WARNING: This feature stopped working in 7.2.0.x version of plugin.
Do not upgrade your plugin!
Do not upgrade your plugin!
Re: Call Imacros from JS Under FireFox
Hey guys,
It's been a while since the last post here. Sorry for bringing this thread alive but I'm in desperate need of this functionality:
"http://run.imacros.net/?code=YOURCODEHERE"
Does this still work ?
I tried adding a simple code in there but it just keeps on loading. Nothing is happening.
Any tips ?
Thank you !
It's been a while since the last post here. Sorry for bringing this thread alive but I'm in desperate need of this functionality:
"http://run.imacros.net/?code=YOURCODEHERE"
Does this still work ?
I tried adding a simple code in there but it just keeps on loading. Nothing is happening.
Any tips ?
Thank you !
Re: Call Imacros from JS Under FireFox
CIM...! (Always mention your FCI (read my Sig) when you open a Thread or post for the first time in an existing Thread, many Commands are not implemented for all Browsers/Versions or get broken from some specific Version...)COSMOS wrote:Hey guys,
It's been a while since the last post here. Sorry for bringing this thread alive but I'm in desperate need of this functionality:Does this still work ?Code: Select all
http://run.imacros.net/?code=YOURCODEHERE
I tried adding a simple code in there but it just keeps on loading. Nothing is happening.
Any tips ?
Thank you !
But, yep, I think this Syntax doesn't work anymore since a few years, but [url=imacros://run/?code=VkVSU0lPTiBCVUlMRD04ODIwNDEzIFJFQ09SREVSPUZYDQpVUkwgR09UTz1odHRwOi8vZm9ydW0uaW1hY3Jvcy5uZXQvdmlld3RvcGljLnBocD9mPTExJnQ9MjY3NDUjcDcxMDkx]this one[/url] should work, ah-ah...!
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3. (=FF47), Win10-x64.)
And I used this Site to base64-encode my mini-Macro (which simply takes you to some other Thread on the Forum with more 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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...