Subscripts, how to use then?

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Subscripts, how to use then?

by topmktwww on Fri Nov 18, 2016 9:30 am

Hello for all,

I just created a scipt called main.iis with the following code,
but the script is just ronning the first one.

URL GOTO=imacros://run/?m=firstscript.iim
URL GOTO=imacros://run/?m=secondscript.iim
URL GOTO=imacros://run/?m=thirdscript.iim

but the system is just running the first one,

What should I include on this command ?

thank you all

Robson
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by chivracq on Fri Nov 18, 2016 2:30 pm

topmktwww wrote:
Code: Select all
Firefox:49.0.2
Imacros:9.0.3


Hello for all,

I just created a scipt called main.iis with the following code,
but the script is just ronning the first one.

Code: Select all
URL GOTO=imacros://run/?m=firstscript.iim
URL GOTO=imacros://run/?m=secondscript.iim
URL GOTO=imacros://run/?m=thirdscript.iim


but the system is just running the first one,

What should I include on this command ?

thank you all

Robson

Hum, you should still hard-code your FCI in your OP when you open a new Thread as you only have one Dynamic Sig for the whole Forum...
OS is missing btw...

I don't know this ".iis" Extension for your 'main.iis' "scipt", but your Post is full of Typos, pay attention a bit to your Spelling, I hope you don't include that many Typos in your Scripts, Runtime Engines are very stupid...!

But yep, normal, the (unsupported...!) 'run/?m=' Syntax works for one '.iim' Macro to call a next '.iim' or '.js' Script which then becomes the "main" Script and doesn't know anything about what happened before it got launched, so if you want to get your 'secondscript.iim' to run, you must call it using that Syntax again at the end of 'firstscript.iim', etc...

But a more "Standard" way would be to use a main '.js' Script from which you can call all your 3 Sub-Scripts in a row using the 'iimPlay()' Command.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Subscripts, how to use then?

by topmktwww on Mon Nov 21, 2016 3:28 am

Here it goes.

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed

Anything else ?
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by chivracq on Mon Nov 21, 2016 6:24 am

topmktwww wrote:Here it goes.

Code: Select all
Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed


Anything else ?

Ah-ah...!, no, perfect... And it doesn't change anything to my previous Reply about the "behavioral Mechanism" for Sub-Scripts as you remain within the "iMacros for FF Family" and (luckily), nothing changed between v8.8.x / v8.9.x / v9.0.x for that Functionality...

So, did you understand the Mechanism...?

>>>

Stg else that changed (some Bug that appeared somewhere between v8.8.2 and v8.9.7) is a (newly discovered) Bug mentioned in this Thread, and I would be interested if you could take 1 min to test if the Bug was already present in v8.8.7 or not.
It's basically about running this little Script:
Code: Select all
EVENT TYPE=KEYPRESS SELECTOR=* KEY=33 MODIFIERS="ctrl"
and/or
Code: Select all
EVENT TYPE=KEYPRESS SELECTOR=* KEY=34 MODIFIERS="ctrl"
which, when you have several Tabs open, is supposed to navigate to the previous Tab (Key=33 for 'Ctrl^PgUp') or the next Tab (Key=34 for 'Ctrl^PgDn').
(You can post your Results here or (preferably) in the other Thread (+ mentioning in which FCI you tested of course)...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Subscripts, how to use then?

by topmktwww on Mon Nov 21, 2016 11:55 am

I have solved my problem using this script on java:

var retcode;

retcode = iimPlay("macro1")

if (retcode < 0) {
retcode = iimPlay("macro2")
}

if (retcode < 0) {
retcode = iimPlay("macro3")
}


Thank you all for guidance and information.
Last edited by topmktwww on Tue Nov 22, 2016 4:20 am, edited 1 time in total.
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by topmktwww on Mon Nov 21, 2016 2:18 pm

Almost there I am working o this script, but is playing only the first one, and is not repeating...

could you please guys, take a look and point the error?

thank you all.

var loops = 20;
var scripts = ["first.iim", "second.iim", "third.iim"]

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

for(k = 1; k <= loops; k++){

for(i = 0; i < scripts.length; i++){
iimSet("ARRAY", scripts[i]);
iimPlay(playMacro);
}
}
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by chivracq on Mon Nov 21, 2016 2:52 pm

topmktwww wrote:I have solved my problem using this script on java:
Code: Select all
var retcode;

retcode = iimPlay("macro1")

if (retcode < 0) {
retcode = iimPlay("macro2")
}

if (retcode < 0) {
retcode = iimPlay("macro3")
}


Thank you all for guidance and information.

Well, it's not "java" but JavaScript, and Thanks for Sharing your Solution...
So OK, I see from the Logic in your Script now that you only wanted to run the next Macro in case the previous failed, was not to guess from your previous Post. But OK, glad your Script is now working... :D 8)

I had asked you if you could do some mini-Testing with v8.8.7, no Feedback about that in this Thread or the "other" one, OK, no Pb..., everybody busy with their own "Life" and 'Interests", ah-ah...! No Pb/Pressure about that, the "Bug" still exists in v8.9.7/v9.0.3, so knowing or not if it was already hitting v8.8.7 won't solve it in those 2 Versions...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Subscripts, how to use then?

by topmktwww on Mon Nov 21, 2016 3:23 pm

your code worked as expected, the first one make I change the tab on my browser, the same the second script.
Last edited by topmktwww on Tue Nov 22, 2016 4:20 am, edited 1 time in total.
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by topmktwww on Mon Nov 21, 2016 3:24 pm


var loops = 20;
var scripts = ["first.iim", "second.iim", "third.iim"]

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

for(k = 1; k <= loops; k++){

for(i = 0; i < scripts.length; i++){
iimSet("ARRAY", scripts[i]);
iimPlay(playMacro);
}
}




If I can fix this script will be better to the comunity, I think I am close,
Like I have explained, is only running the first script (first.iim) and is not doing the loop process.
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by chivracq on Mon Nov 21, 2016 10:28 pm

Oh..., I thought you were settled, you can remove your Quotes of my Posts, I do quote Users systematically on the Forum when I reply (or not...!) because many Users tend to delete their OP once they got some Answer which otherwise render their Thread completely useless for other Users trying to understand/follow this Thread for a possible Solution for their own Pb..., but unless several other (Advanced) Users replied to your last Reply and you want to make your Reply specific to that Reply with Quote, but otherwise, not needed, so please remove..., as it makes the Thread more difficult to follow...

(But OK, I'm a Mod on this Forum, and I won't delete my own Posts ah-ah...!, pfff, I quote Posts from other Users for "good" Reasons...!)

Then, sorry, a little bit of "Leverage", answer my Qt that I've been asking you already twice about the "other" Thread before I will be doing any Digging in your Thread again..., pfff, sorry, I shouldn't have to ask, filling a bit pissed, not at your service all the time, I help you like I help all Users... :roll:
(The "Principle" of the Forum is "Users helping Users", I'm a User, you are a User...! Gling-Gling...!!, you get the Msg...!?)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Subscripts, how to use then?

by topmktwww on Tue Nov 22, 2016 4:23 am

Yes I got you message and thank you for your help.
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am

Re: Subscripts, how to use then?

by topmktwww on Tue Nov 22, 2016 9:37 am

I have made a small improvement on the javascript, and for each loop the system wait the time configured.

var loopcounter = 10
var seconds = 150;
var waitSecondss;

for (i=1;i<=loopcounter;i++){
iimPlay("macro01.iim");
iimPlay("macro02.iim");
iimPlay("macro03.iim");

waitSecondss = "CODE:";
waitSecondss += "SET !ERRORIGNORE YES" + "\n";
waitSecondss += "URL GOTO=http://addmefast.com" + "\n";
waitSecondss += "WAIT SECONDS={{SECONDS}}" + "\n";

iimSet("SECONDS", seconds);
iimPlay(waitSecondss);
}
My Best Regards / Saludos / Atenciosamente

Robson G. Barros

Pale Moon = 26.5.0 x86 (I have just Changed)
Windows 7 SP1 US Language Version
Imacros = 8.8.7.1-signed
topmktwww
 
Posts: 11
Joined: Thu Nov 17, 2016 5:04 am


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->