[FREE] iMacros to Java Script Converter

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

[FREE] iMacros to Java Script Converter

Post by Tanckom » Thu Jun 30, 2016 7:32 pm

So, as some have seen in my previous post, I created a iMacros to Java Script converter, since the iMacros Code Creator is outdated.
Feel free to use and do whatever you want ;) (except to commercialise it)
Image

Download: iMacros to Java Script converter
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
serbeer
Posts: 44
Joined: Fri Sep 11, 2015 5:36 am

Re: [FREE] iMacros to Java Script Converter

Post by serbeer » Fri Jul 01, 2016 7:00 pm

Thank you Tanckom.

Could you please give a hint in what way this converter has a leg up on iMacros Code Creator v0.16? Is there a feature or improvement over it that you implemented in this release?

Thanks!
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Mon Jul 04, 2016 2:16 pm

Hello, first sorry for the late reply.
Second, yes there is/are improvements.

The iMacros Code Creator didnt escape in java scripts the " and \ symbols. Which means in several occasions that the code is finished here.
Due this, iMacros responded with an error, since it couldnt read anything what came after these two symbols.
You can however escape those symbols by adding a \ symbol BEFORE those symbols.

Try out a script with one of both symbols, and convert them with both tools. You can see the difference in the end.
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
serbeer
Posts: 44
Joined: Fri Sep 11, 2015 5:36 am

Re: [FREE] iMacros to Java Script Converter

Post by serbeer » Wed Jul 06, 2016 8:57 pm

Tanckom wrote:Hello, first sorry for the late reply.
Second, yes there is/are improvements.

The iMacros Code Creator didnt escape in java scripts the " and \ symbols. Which means in several occasions that the code is finished here.
Due this, iMacros responded with an error, since it couldnt read anything what came after these two symbols.
You can however escape those symbols by adding a \ symbol BEFORE those symbols.

Try out a script with one of both symbols, and convert them with both tools. You can see the difference in the end.
I got it. Yes, it is a major advantage indeed, as this problem is the main reason I did not use the Code Creator for all of my scripting--since I use Event mode a lot and it has quotes.
I am going to try out your converter, and thank you for releasing it for public use!
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Thu Jul 07, 2016 9:20 am

You're welcome ;)
I'll think I'll combine it with the csv converter :)
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
serbeer
Posts: 44
Joined: Fri Sep 11, 2015 5:36 am

Re: [FREE] iMacros to Java Script Converter

Post by serbeer » Thu Jul 07, 2016 5:09 pm

Tanckom wrote:You're welcome ;)
I'll think I'll combine it with the csv converter :)
Good idea. And in csv converter, would be nice to get some confirmation that the file was written. Right now, pressing Create File button has no visual indication of success of failure, which is very unusual. The only way to find out is to check the directory to see if the file was indeed created...
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Thu Jul 07, 2016 5:12 pm

Will do ;)
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Sun Jul 10, 2016 4:44 pm

v1.0.1 is out. Bugfix of: When last line was empty it didnt add the iimPlay. Fixed it and now working flawlessly
Last edited by Tanckom on Mon Jul 11, 2016 9:51 pm, edited 1 time in total.
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
serbeer
Posts: 44
Joined: Fri Sep 11, 2015 5:36 am

Re: [FREE] iMacros to Java Script Converter

Post by serbeer » Mon Jul 11, 2016 7:33 pm

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

Re: [FREE] iMacros to Java Script Converter

Post by chivracq » Sun Sep 18, 2016 3:05 pm

FYI, some new Forum User (@lemot) developed a similar Tool:
- Javascript Bootstrap for iMacros Code
- (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...
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Mon Sep 19, 2016 10:36 am

Isnt that the same? :p
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: [FREE] iMacros to Java Script Converter

Post by chivracq » Mon Sep 19, 2016 1:01 pm

Tanckom wrote:Isnt that the same? :p
I don't know, I don't use '.js' Scripts so I don't really know where to look to test it/them a bit...

Would be interesting if you could test it and post an (objective!) Comparison with your own Converter..., with strong points for both..., and maybe this new Tool will contain some Features that could help you even improve your own Tool... :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...
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Tue Sep 20, 2016 8:10 pm

Hehe, mine is better. This tool doesnt escape special characters like " and \ and is therefore till a level useless. Moreover is the converted code incomplete. :D = I WIN
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: [FREE] iMacros to Java Script Converter

Post by chivracq » Tue Sep 20, 2016 8:29 pm

Tanckom wrote:Hehe, mine is better. This tool doesnt escape special characters like " and \ and is therefore till a level useless. Moreover is the converted code incomplete. :D = I WIN
OK, I'm not surprised about the not escaped Chars, your Converter was not working perfectly either from the first Version, would be more useful if you could be more precise, maybe with some Table and Checks on Features for both Tools, together with some Test '.iim' Script that you used to test them both, together with both Results... (and the Differences)...
- (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...
Tanckom
Posts: 79
Joined: Fri Jan 15, 2016 12:12 pm

Re: [FREE] iMacros to Java Script Converter

Post by Tanckom » Thu Oct 06, 2016 1:12 pm

True that ;) but I worked on it and quickly fixed it after release.

No need for tables etc.
1. In fact, that the JavaScript can work, you need to specify the used variable which would be in our case "macro".
2. Next you need to add every line of iMacros to your new variable in JavaScript, but the first added line must be "CODE:".
3. Then you need to check all lines for special characters like " and \, if they contains these characters, they need to be escaped with \ characters.
4. When checked, add in the end of each line a + "\n";
5. Finally, add the iimPlay(macro) where macro is your used variable.

The RegExr tool maybe only provides part 4 and some others. The RegExr tool doesnt escaped the " and \ symbols, you can't specifiy the used variable and the first two lines (Standard -> part 1 and part 2) and the last line (part 5) are missing.

My tool however allows you to specify a variable, adds the beginning and ending and escaped the characters.


var macro;
macro = "CODE:";
... <-- EVERYTHING BETWEEN HERE IS WHAT REGEXR DOES
iimPlay(macro)
FCIM
Firefox: 56.0
Os: Windows 10 x64
iMacros: 9.0.3
Post Reply