How do we call or execute the next macro?

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
Post Reply
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

How do we call or execute the next macro?

Post by webcan » Mon Oct 05, 2015 8:15 pm

HI! How do we call another macro or execute the following macro?

I want to keep certain macros separated ( because sometime I need to change certain things and I cannot put all the macros in one big file either )
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How do we call or execute the next macro?

Post by chivracq » Mon Oct 05, 2015 8:23 pm

webcan wrote:HI! How do we call another macro or execute the following macro?

I want to keep certain macros separated ( because sometime I need to change certain things and I cannot put all the macros in one big file either )
CIM...! :mrgreen:
Consider one day reading the Forum Rules for Required Info if you want me to answer any of your Threads... :idea:

And your Question should be a basic Question for sbd who's been using iMacros for at least 5 years, from the Date of your Registration on the Forum... :shock:
- (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...
IrishMacro
Posts: 135
Joined: Wed Nov 03, 2010 12:27 pm

Re: How do we call or execute the next macro?

Post by IrishMacro » Tue Oct 06, 2015 10:27 am

The way to go is using a JS

It will look something like this https://ip.bitcointalk.org/?u=http%3A%2 ... Mf52xwy5TA

Use this code :

var i, retcode;
var report;
var macrolist = new Array();

macrolist.push("FirstMacro.iim")
macrolist.push("SecondMacro.iim")
macrolist.push("ThirdMacro.iim")

report = "Test report\n\n";

for (i = 0; i < macrolist.length; i++) {
iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist);
retcode = iimPlay(macrolist);
report += macrolist;
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
s = iimGetLastExtract(1);
/* if ( s != "" ) report += ", Extract: "+s; */
}
report += "\n";
}
alert ( report );
Firefox free plugin, last version
Win7
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How do we call or execute the next macro?

Post by chivracq » Tue Oct 06, 2015 12:15 pm

IrishMacro wrote:The way to go is using a JS

It will look something like this https://ip.bitcointalk.org/?u=http%3A%2 ... Mf52xwy5TA

Use this code :

Code: Select all

var i, retcode;
var report;
var macrolist = new Array();
 
macrolist.push("FirstMacro.iim")
macrolist.push("SecondMacro.iim")
macrolist.push("ThirdMacro.iim")

report  =  "Test report\n\n";

for (i = 0; i < macrolist.length; i++) {
    iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist[i]);
    retcode = iimPlay(macrolist[i]);
    report += macrolist[i];
    if (retcode < 0) {
        report += ": "+iimGetLastError();
      } else {
        report += ": OK";
        s = iimGetLastExtract(1);
/*	  if ( s != "" )  report += ", Extract: "+s;      */
    }
    report += "\n";     
}
alert ( report );
Oh good...!, sbd at least managed to find the Demo-Macros... :D

But 'Webcan' didn't mention anything about their Environment and the above Copy&Paste of the 'Self-Test.js' Demo-Macro for iMacros for FF will only work in iMacros for FF and not in other Browsers unless using the Scripting Interface... => I would soften "The way to go is using a JS." to "A way to go is using a JS."...
- (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...
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Re: How do we call or execute the next macro?

Post by webcan » Tue Oct 06, 2015 9:13 pm

@IrishMacro, Thank you very much, that was exactly what I was looking for... :)

PS: Is there another site that you know of that post get more useful/helpful replies that this one for macros. This one seems to get mostly answers from a pretentious tard ( not pointing fingers ) telling users to look up the forum rules for simple questions like the one you just answered! :roll:
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How do we call or execute the next macro?

Post by chivracq » Tue Oct 06, 2015 9:56 pm

webcan wrote:@IrishMacro, Thank you very much, that was exactly what I was looking for... :)
Well then you didn't look very hard for it if you never bothered to have a look at the Demo-Macros since at least 5 years that you must have been using iMacros... :roll:
And that Question has already been asked and answered many times on the Forum.

=> Probable FCI: iMacros for FF v8.9.4, FF41.
webcan wrote:PS: Is there another site that you know of that post get more useful/helpful replies that this one for macros. This one seems to get mostly answers from a pretentious tard ( not pointing fingers ) telling users to look up the forum rules for simple questions like the one you just answered! :roll:
Yeah, you have Stackoverflow but the Quality of the Threads/Answers (for iMacros) is pretty low (and Answers are often half/completely erroneous but I rarely correct them) except for pure JavaScript Questions (which is then better than the iMacros Forum).
Users answering Questions on SOF are mainly preoccupied by gaining Reputation Points... But don't try to ask there a Question which has already been asked and answered, you will get there directly some "pretentious tard (tart...?)" as well pointing you at your laziness for not searching the Forum and you will quickly regret the iMacros Forum... :idea: :roll:

Sorry you find me a "pretentious tard" because you were too lazy to read the Forum Rules nor search the Forum nor read any Documentation...
I help Users who do their part of the Job and really get stuck with a Problem after they've already done their best to try to find a Solution, not lazy Script Kiddies Likes who can only Copy&Paste an existing Script found on some obscure Forum without (trying to) understand(ing) what the Script is doing... :roll: :oops:
- (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...
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Re: How do we call or execute the next macro?

Post by webcan » Thu Oct 08, 2015 9:45 pm

IrishMacro wrote:The way to go is using a JS

It will look something like this https://ip.bitcointalk.org/?u=http%3A%2 ... Mf52xwy5TA

Use this code :

var i, retcode;
var report;
var macrolist = new Array();

macrolist.push("FirstMacro.iim")
macrolist.push("SecondMacro.iim")
macrolist.push("ThirdMacro.iim")

report = "Test report\n\n";

for (i = 0; i < macrolist.length; i++) {
iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist);
retcode = iimPlay(macrolist);
report += macrolist;
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
s = iimGetLastExtract(1);
/* if ( s != "" ) report += ", Extract: "+s; */
}
report += "\n";
}
alert ( report );


HI! the script works but it stops between each script I think due to an open " upload dialog box " ( IF I close the upload dialog box it continues ). If I do not use the js script and just run 1 Macro with the FF plug macro version ( Play LooP ) it will continue looping even though the upload dialog box is open BUT will leave multiple dialog boxs open (it only works for 1 macro with looping though).

Here is an example of a 1 of the macros the Js script is calling..( I shortened it a bit and removed unnecessary stuff )
---------------------Macro 1 -----------------------

VERSION BUILD=8940826 RECORDER=FX
TAB T=1
URL GOTO=http://www.kijiji.ca/p-select-category. ... egoryId=37
WAIT SECONDS=1
TAG POS=1 TYPE=A ATTR=ID:PostAdLink
WAIT SECONDS=1
TAG POS=1 TYPE=A ATTR=ID:CategoryId37
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:PostAdMainForm ATTR=ID:postad-title CONTENT=<SP>XXXXXXXXXXXXXXXXX
TAG POS=1 TYPE=SELECT FORM=ACTION:/p-submit-ad.html ATTR=NAME:locationLevel0 CONTENT=%1700281
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/p-submit-ad.html ATTR=* CONTENT=C:\Users\XXX<SP>Drive\fff<SP>XXX<SP>Docs\Advertizing\RH<SP>XXX\yyy<SP>XXX\1.jpg
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ACTION:/p-submit-ad.html ATTR=TXT:Select<SP>Images
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/p-submit-ad.html ATTR=* CONTENT=C:\Users\XXX<SP>Drive\fff<SP>XXX<SP>Docs\XXX\RH<SP>XXX\yyy<SP>XXX\2.JPG
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON FORM=ID:PostAdMainForm ATTR=NAME:saveAndCheckout
----------------------------end of Macro 1 ------------------------------

------------Js File ------------------------

var i, retcode;
var report;
var macrolist = new Array();

macrolist.push("Macro1.iim")
macrolist.push("Macro2.iim")
macrolist.push("Macro3.iim")

report = "Test report\n\n";

for (i = 0; i < macrolist.length; i++) {
iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist);
retcode = iimPlay(macrolist);
report += macrolist;
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
s = iimGetLastExtract(1);
/* if ( s != "" ) report += ", Extract: "+s; */
}
report += "\n";
}
alert ( report );
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Re: How do we call or execute the next macro?

Post by webcan » Thu Oct 08, 2015 9:50 pm

another thing is how to tackel this issue, since its the macro thats opening the dialog box then can we close it? ( I tried seeing if any of the recording options would help but no cigar ) or should we consider using a different method of opening the images?

ON the other hand---

Since its the JS script also that starts the call is halting due to an open dialog box do we handle the issue from the js file? should we instruct the script to continue ( if its possible ) even though there is a modal open dialog box open?
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Re: How do we call or execute the next macro?

Post by webcan » Thu Oct 08, 2015 10:29 pm

PS: I thought that I would add something. The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though.

http://forum.imacros.net/viewtopic.php? ... box#p50284

I would like to further state. some other info that may be useful in this case.

OS: Win 7 Ultimate ( Latest service pack as of October 08 2015 ) It you need it to be more precise just ask :)
Browser: Firefox ESR 38.3.0
Imacro version for Firefox 8.9.4
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How do we call or execute the next macro?

Post by chivracq » Sat Oct 10, 2015 3:06 pm

webcan wrote:PS: I thought that I would add something. The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though.

http://forum.imacros.net/viewtopic.php? ... box#p50284

I would like to further state. some other info that may be useful in this case.

OS: Win 7 Ultimate ( Latest service pack as of October 08 2015 ) It you need it to be more precise just ask :)
Browser: Firefox ESR 38.3.0
Imacro version for Firefox 8.9.4
"The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though."

=> Yep, normal as you never mentioned your FCI... That's why I tried to point you in the good direction with my first Reply in this current Thread and you were lucky that sbd else jumped on your Thread as I'm usually the most active Helper on this Forum, but you preferred to react a bit aggressively... But nice that you now mention your FCI... :D
(But I won't answer your Threads anymore/anyway..., good luck with other Advanced Users and/or TechSupport...)
- (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...
User avatar
webcan
Posts: 21
Joined: Thu Feb 18, 2010 6:34 am
Location: Montreal

Re: How do we call or execute the next macro?

Post by webcan » Sun Oct 11, 2015 10:26 am

chivracq wrote:
webcan wrote:PS: I thought that I would add something. The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though.

http://forum.imacros.net/viewtopic.php? ... box#p50284

I would like to further state. some other info that may be useful in this case.

OS: Win 7 Ultimate ( Latest service pack as of October 08 2015 ) It you need it to be more precise just ask :)
Browser: Firefox ESR 38.3.0
Imacro version for Firefox 8.9.4
"The issue regarding the upload box staying open has also already been posted a while back..I do not see any resolve though."

=> Yep, normal as you never mentioned your FCI... That's why I tried to point you in the good direction with my first Reply in this current Thread and you were lucky that sbd else jumped on your Thread as I'm usually the most active Helper on this Forum, but you preferred to react a bit aggressively... But nice that you now mention your FCI... :D
(But I won't answer your Threads anymore/anyway..., good luck with other Advanced Users and/or TechSupport...)
"Yep, normal as you never mentioned your FCI" That's because its not my post ( its someone else' post that I have not seen any resolve to)
"react a bit aggressively" That because you are acting condescending and rude and are assuming things for you own convenience of using it as tool to laugh or belittle the posters.
And even in this very post once again you are using it as a way of provoking a negative response out of me. ( as you failed to answer the question, Again!!! )( This is called TROLLING )..

You do not speak for other advanced users ( That I am sure of as in the past I have met some very nice users even devs that were polite and respectful ) and as far as tech support well, I will send them this post and see what they say!!!

I do not know if there is a MOD or DEV that monitors these forums ( as another poster has asked ) But I pretty much have had enough of you trying to TROLL ME..

Do not answer anymore of my post plz

Thank you.
Post Reply