iim/js replay bug OR missing syntax?

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
Post Reply
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

iim/js replay bug OR missing syntax?

Post by rethinkreality » Sun Nov 22, 2015 3:52 pm

FF [42.0]
iMacros [8.9.4]
OS [Snow Leopard, Mountain Lion, Mavericks]

This is my code.

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
TAB T=1
URL GOTO=imacros://run/?m=2.iim
WAIT SECONDS=2
TAB T=1
URL GOTO=imacros://run/?m=3.iim
TAB T=1
URL GOTO=imacros://run/?m=Master.js
This code will only run the first imacros script [2.iim] Why is this? TAB T=1 is optional.
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Mon Nov 23, 2015 12:31 am

rethinkreality wrote:

Code: Select all

FF [42.0]
iMacros [8.9.4] 
OS [Snow Leopard, Mountain Lion, Mavericks]
This is my code.

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
TAB T=1
URL GOTO=imacros://run/?m=2.iim
WAIT SECONDS=2
TAB T=1
URL GOTO=imacros://run/?m=3.iim
TAB T=1
URL GOTO=imacros://run/?m=Master.js
This code will only run the first imacros script [2.iim] Why is this? TAB T=1 is optional.
Yep, normal, everything after calling "URL GOTO=imacros://run/?m=2.iim" is never executed because you switch from one .iim Macro to another one...

If you want your Flow" to keep running, you must put "URL GOTO=imacros://run/?m=3.iim" at the end of '2.iim' etc..., or you launch all .iim Macros from a main .js Script with 'iimPlay()' but you cannot launch a .js Script from a .js Script, but there is a Workaround, I don't remember for sure, but I guess calling it from the previous .iim 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...
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Mon Nov 23, 2015 5:29 pm

You mean at the end of the file? Like this ?

1st file

Code: Select all

[1.iim] 
lines of code bla bla bla 
bla bla 
...

URL GOTO=imacros://run/?m=2.iim
2nd file

Code: Select all

[2.iim] 
lines of code bla bla bla 
bla bla 
...

URL GOTO=imacros://run/?m=3.iim
3rd file

Code: Select all

[3.iim] 
lines of code bla bla bla 
bla bla 
...

URL GOTO=imacros://run/?m=4.iim
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Mon Nov 23, 2015 7:02 pm

rethinkreality wrote:You mean at the end of the file? Like this ?

...
Yep, exactly...

But the "normal" way to do what you want is either to concatenate all .iim Macros into one big Macro or to play them in sequence using 'iimPlay()' in some main .js Script (and you can take advantage of 'iimDisplay()' and/or check on each Return Code to conditionally re-run a particular .iim Macro), TechSupport don't like the .iim_1 calling .iim_2 Syntax you are using and they don't support it, and it has one big Drawback:
At the moment of .iim_1 switching to .iim_2, .iim_2 will be launched in the FF Instance and the Tab in that Instance that has the Focus (in the same FF Profile), which can be annoying if you have your .iim_1 running in some (minimized) Window and you do stg else in some other FF Window. The Workaround is then to dedicate a FF Profile to the Macros and to "work" or browse in some other FF Profile.

The only a bit legit purpose to use this Syntax in my Opinion (and that's the reason I use it as well), is if some "things" can go wrong or may need to be run again in/from .iim_2 or .iim_3 and you don't want/need to run .iim_1 again.

Or if you compute dynamically the Name of the next Macro to run, following the Technique I explained in this Thread/Post:
- Re: IE Plugin Loop
.
- (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...
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Mon Nov 23, 2015 11:45 pm

Excellent. It works for this current project of mine.

You gave me an idea, so I coded this. It works if anyone else needs it.

Code: Select all

var script = ["1.js", "2.js", "3.js"];

var playMacro;
playMacro = "CODE:";
playMacro += "URL GOTO=imacros://run/?m={{ARRAY}}" + "\n";
playMacro += "WAIT SECONDS=2" + "\n";

for(i = 0; i<script.length; i++){
iimSet("ARRAY", script[i]);
iimPlay(playMacro);}
PS: Nice thread, you constantly amaze me with what you can do with pure iim.
Last edited by rethinkreality on Tue Nov 24, 2015 3:02 am, edited 2 times in total.
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Tue Nov 24, 2015 12:11 am

rethinkreality wrote:Excellent. It works for this current project of mine.

You gave me an idea, so I coded this. I think it works to play any macro in javascript.

Code: Select all

var script = ["1.js", "2.js", "3.js"];

var playMacro;
playMacro = "CODE:";
playMacro += "URL GOTO=imacros://run/?m={{ARRAY}}" + "\n";
playMacro += "WAIT SECONDS=2" + "\n";

for(i = 0; i<script.length; i++){
iimSet("ARRAY", script[i]);
iimPlay(playMacro);}
Yep, very good, it works indeed, that's a known Workaround, you just make it nicer with the Array Construction... 8)

But the moral is that when you are Creative, you don't need any Help from anybody else, you always come up with a Solution, unless you really encounter a Bug..., that's actually how I came to the Forum about 2 or 3 years ago, feeling very modest and shy to report a Bug but I was a bit surprised then to see that most Threads were about Questions/Pb's I had had myself previously and had solved by myself quite easily. And I was then already doing "things" with iMacros that were way more complex than all Threads I saw/read then when I joined, and now even more of course...
And even the "Bug" Argument, I would now be able to solve them by myself, I've run my own customized Version of iMacros for a while, that might be a very interesting Thread for you to read, you seem like you are much-much more "fluent" than me at JavaScript (that I only use for 'EVAL()' Statements), look for a Thread with Participation by / initiated by 'Sightunseen' (and me of course, but's it's easier to search on this other very talented User) and "js-beautifier / js-beautifuler /decompile" etc...
Here I gave the Method that I use:
- Unresponsive script warning while executing iim from js file
- Extend Imacros with new commands?

(And now I need to bookmark those 2 threads myself to find them back a bit more easily next time I need them...! :idea: )
Last edited by chivracq on Tue Nov 24, 2015 2:58 pm, edited 2 times in total.
- (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...
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Tue Nov 24, 2015 12:51 am

chivracq wrote: Yep, very good, it works indeed, that's a known Workaround, you just make it nicer with the Array Construction... 8)

But the moral is that when you are Creative, you don't need any Help from anybody else, you always come up with a Solution, unless you really encounter a Bug..., that's actually how I came to the Forum about 2 or 3 years ago, feeling very modest and shy to report a Bug but I was a bit surprised then to see that most Threads were about Questions/Pb's I had had myself previously and had solved by myself quite easily. And I was then already doing "things" with iMacros that were way more complex than all Threads I saw/read then when I joined, and now even more of course...
And even the "Bug" Argument, I would now be able to solve them by myself, I've run my own customized Version of iMacros for a while, that might be a very interesting Thread for you to read, you seem like you are much-much more "fluent" than me at JavaScript (that I only use for 'EVAL()' Statements), look for a Thread with Participation by / initiated by 'Sightunseen' (and me of course, but's it's easier to search on this other very talented User) and "js-beautifier / js-beautifuler /decompile" etc...
Here I gave the Method that I use:
- Unresponsive script warning while executing iim from js file
- Extend Imacros with new commands?

(And now I need to bookmark those 2 threads myself to find them back a bit more easily next time I need them...! :idea: )
I spent the last little while reading yours and sightunseen's messages. (those very post too! lol) I think it's time for me to make some personalized edits to iMacros, thanks for that.
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Tue Nov 24, 2015 3:13 am

chivracq wrote: Yep, very good, it works indeed, that's a known Workaround, you just make it nicer with the Array Construction... 8)
I had a typo in it, fixed it. Want to update your post?
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Tue Nov 24, 2015 6:00 am

rethinkreality wrote:
chivracq wrote: Yep, very good, it works indeed, that's a known Workaround, you just make it nicer with the Array Construction... 8)
I had a typo in it, fixed it. Want to update your post?
Yep, done I think, about...:

Code: Select all

playMacro += "URL GOTO=imacros://run/?m=ADDMEFAST/{{ARRAY}}" + "\n";
=>

Code: Select all

playMacro += "URL GOTO=imacros://run/?m={{ARRAY}}" + "\n";
And that's funny because I nearly said stg about you being "lucky" to be on MacOS because on Win32/64, Paths can be a big hassle with this Syntax because of the Backslashes that need to be doubled or tripled or replaced with forward Slashes sometimes still escaped...
rethinkreality wrote: I spent the last little while reading yours and sightunseen's messages. (those very post too! lol) I think it's time for me to make some personalized edits to iMacros, thanks for that.
Yep, I've been asking for too long to have a '!LOOP_MAX' Var that could be set (and retrieved if set from the 'Play Loop' Field in the Side Panel) from within a Macro, superseding or not the Value set in 'Play Loop', I "threatened" months ago to implement it myself, I don't think it will happen from Dev, so I guess I need to dig into the "mud"...
I have several Macros where I want to do stg special only in the last Run, and I can only do it if I specify the '!LOOP_MAX' Value from within the Macro with a Negative Value... Or use a PROMPT in the first Run, but again there is a Bug ('alert()' doesn't work in 'URL GOTO' even if advertised in the Wiki...), it's not possible to use a Conditional PROMPT only for one specific run, I have a Workaround, but it's cumbersome and it should be much easier... I guess I'm never taken seriously when I report a Bug because I always find a Workaround..., Grrr...!! :twisted:

"... I think it's time for me to make some personalized edits to iMacros..."
=> Yes, do it...! And share, I'll be of course very-very interested..., oops...! 8)
- (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...
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Tue Nov 24, 2015 8:55 am

chivracq wrote: Yep, done I think, about...:
You got it, except for this one character too

Code: Select all

iimSet("ARRAY", scripts[i]);
should be this

Code: Select all

iimSet("ARRAY", script[i]);
because there is no variables named scripts, but there is one named script. One of the two has to change.
chivracq wrote: And that's funny because I nearly said stg about you being "lucky" to be on MacOS because on Win32/64, Paths can be a big hassle with this Syntax because of the Backslashes that need to be doubled or tripled or replaced with forward Slashes sometimes still escaped...
Lack of sleep makes it hard on everybody too lol.
chivracq wrote: Yep, I've been asking for too long to have a '!LOOP_MAX' Var that could be set (and retrieved if set from the 'Play Loop' Field in the Side Panel) from within a Macro, superseding or not the Value set in 'Play Loop', I "threatened" months ago to implement it myself, I don't think it will happen from Dev, so I guess I need to dig into the "mud"...
I have several Macros where I want to do stg special only in the last Run, and I can only do it if I specify the '!LOOP_MAX' Value from within the Macro with a Negative Value... Or use a PROMPT in the first Run, but again there is a Bug ('alert()' doesn't work in 'URL GOTO' even if advertised in the Wiki...), it's not possible to use a Conditional PROMPT only for one specific run, I have a Workaround, but it's cumbersome and it should be much easier... I guess I'm never taken seriously when I report a Bug because I always find a Workaround..., Grrr...!! :twisted:

"... I think it's time for me to make some personalized edits to iMacros..."
=> Yes, do it...! And share, I'll be of course very-very interested..., oops...! 8)
I'm not sure ipswitch would like me posting a mod on the forum, but i'm not opposed to sharing the results. We should talk about this in greater detail.
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Tue Nov 24, 2015 3:16 pm

rethinkreality wrote:
chivracq wrote: Yep, done I think, about...:
You got it, except for this one character too

Code: Select all

iimSet("ARRAY", scripts[i]);
should be this

Code: Select all

iimSet("ARRAY", script[i]);
because there is no variables named scripts, but there is one named script. One of the two has to change.
chivracq wrote: And that's funny because I nearly said stg about you being "lucky" to be on MacOS because on Win32/64, Paths can be a big hassle with this Syntax because of the Backslashes that need to be doubled or tripled or replaced with forward Slashes sometimes still escaped...
Lack of sleep makes it hard on everybody too lol.
Oh yep indeed and I should have noticed it, but as you had said "I had a typo in it, fixed it.", I was only looking for 1 Difference and I stopped "scanning" once I found one...
rethinkreality wrote:
chivracq wrote: Yep, I've been asking for too long to have a '!LOOP_MAX' Var that could be set (and retrieved if set from the 'Play Loop' Field in the Side Panel) from within a Macro, superseding or not the Value set in 'Play Loop', I "threatened" months ago to implement it myself, I don't think it will happen from Dev, so I guess I need to dig into the "mud"...
I have several Macros where I want to do stg special only in the last Run, and I can only do it if I specify the '!LOOP_MAX' Value from within the Macro with a Negative Value... Or use a PROMPT in the first Run, but again there is a Bug ('alert()' doesn't work in 'URL GOTO' even if advertised in the Wiki...), it's not possible to use a Conditional PROMPT only for one specific run, I have a Workaround, but it's cumbersome and it should be much easier... I guess I'm never taken seriously when I report a Bug because I always find a Workaround..., Grrr...!! :twisted:

"... I think it's time for me to make some personalized edits to iMacros..."
=> Yes, do it...! And share, I'll be of course very-very interested..., oops...! 8)
I'm not sure ipswitch would like me posting a mod on the forum, but i'm not opposed to sharing the results. We should talk about this in greater detail.
It shouldn't be a Pb, I think... In one of the Threads I referred to, I even decompiled and posted one of the iMacros Add-on Modules (for FF) and I wasn't sure at that time if that would be OK or not with the Moderation/TechSupport but I did some Research on the Forum and iMacros is officially Open-Source (I must have referred to it in one of those 2 Threads, there is some "official" Statement about that from TechSupport in some older Thread), even if iOpus/Ipswitch's Definition of "Open-Source" is a bit of a grey area... But you are officially allowed to modify the Add-on, but don't expect TechSupport to support your customized Version if anything goes wrong of course...!
- (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...
rethinkreality
Posts: 30
Joined: Thu Nov 12, 2015 9:50 pm

Re: iim/js replay bug OR missing syntax?

Post by rethinkreality » Tue Nov 24, 2015 4:37 pm

chivracq wrote: It shouldn't be a Pb, I think... In one of the Threads I referred to, I even decompiled and posted one of the iMacros Add-on Modules (for FF) and I wasn't sure at that time if that would be OK or not with the Moderation/TechSupport but I did some Research on the Forum and iMacros is officially Open-Source (I must have referred to it in one of those 2 Threads, there is some "official" Statement about that from TechSupport in some older Thread), even if iOpus/Ipswitch's Definition of "Open-Source" is a bit of a grey area... But you are officially allowed to modify the Add-on, but don't expect TechSupport to support your customized Version if anything goes wrong of course...!
Got some source code reading to do then, lol I remember you compared it to mud in one post. Should be exciting, maybe sightunseen will like to tackle this with me or even yourself if you're not too busy.
If you want help, make sure to add this information. If you don't, answers may not work for your specific setup.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iim/js replay bug OR missing syntax?

Post by chivracq » Tue Nov 24, 2015 5:23 pm

rethinkreality wrote:Got some source code reading to do then, lol I remember you compared it to mud in one post. Should be exciting, maybe sightunseen will like to tackle this with me or even yourself if you're not too busy.
I mentioned which Decompile Web-Service/Site I was using to js-beautify Modules in the other Thread...

Maybe we should continue the Discussion in that other Thread as it has anyway nothing to do anymore with your Original Question in this Current Thread, in the Thread that was dedicated to extending iMacros with new Commands, and I'll quote there all relevant parts from this Current Thread and the Thread with 'sightunseen' and I will ping him in his Thread, I think he's got Notifications ON for that Thread and he will come to the Forum on a Horse, ah-ah...!
And if he doesn't receive any Notification nor comes to the Forum, I think we had already communicated by Mail before, so I may have his E-Mail Address somewhere... But he checks the Forum from time to time anyway and he will notice the Thread...
- Extend Imacros with new commands?

And yep, I will have some time for some Fun Project of course, even if I'm pretty busy indeed, but I find the time to monitor the Forum regularly as well, "Everything is a Question of Motivation...!", I always say...

Tja, and talking about Horses, I'm going tonight to a nice Concert in Amsterdam by a Friend of mine:
- Curtis Eller: Sugar for the Horses Enjoy...! :D
- (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