Combine codes !!

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
gdsduarte
Posts: 2
Joined: Fri Nov 16, 2018 11:42 am

Combine codes !!

Post by gdsduarte » Fri Nov 16, 2018 11:47 am

Hello
I would like a code for IMacro to do the following tasks:

1st execute a code 1 (code already created)
2º if it appears the text 1 in the page of the web it will execute the code 2 (code already created) in loop.
3º if text 2 appears on the web page it will execute code 1 and return to code 2.
4th if text 1 does not appear and text 2 touches an alarm.

it is possible??
In short, I wanted the Imacro to fill a page, run a function continuously and if it appears a text it starts from the fill and if no text appears that touches an alarm.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Combine codes !!

Post by chivracq » Fri Nov 16, 2018 1:48 pm

gdsduarte wrote:Hello
I would like a code for IMacro to do the following tasks:

1st execute a code 1 (code already created)
2º if it appears the text 1 in the page of the web it will execute the code 2 (code already created) in loop.
3º if text 2 appears on the web page it will execute code 1 and return to code 2.
4th if text 1 does not appear and text 2 touches an alarm.

it is possible??
In short, I wanted the Imacro to fill a page, run a function continuously and if it appears a text it starts from the fill and if no text appears that touches an alarm.
Not sure what "Combine Codes" really means exactly but good News anyway, the answer is "YES"...! :D

Not sure what "Combine Codes" really means exactly but good News anyway, the answer is "YES"...! :D

(The 2nd one is for your (deleted) Duplicate... :wink: )

+ 1 more Happy Customer, this one was easy to solve...! :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...
gdsduarte
Posts: 2
Joined: Fri Nov 16, 2018 11:42 am

Re: Combine codes !!

Post by gdsduarte » Fri Nov 16, 2018 4:49 pm

My friend, thank you for responding!

I admit to being very lazy in Imacro!
I will thoroughly detail my situation here.

I need to schedule a visa and they have dates of the current day up to 60 days ahead, but the schedules in the system are very scarce and appear to the day, which is very difficult to keep updating all the time. :cry:

The site consists of completing a file and then searching the schedules. At first I made the macro 1 of the following form:

VERSION BUILD=12.5.503.8802
TAB T=1
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 0.00
URL GOTO=https://burghquayregistrationoffice.ini ... t?OpenForm
TAG POS=1 TYPE=SELECT ATTR=NAME:Category CONTENT=%Study
TAG POS=1 TYPE=SELECT ATTR=NAME:SubCategory CONTENT=%"English Language Course"
TAG POS=1 TYPE=SELECT ATTR=NAME:ConfirmGNIB CONTENT=%New
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=NAME:UsrDeclaration CONTENT=YES
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:GivenName CONTENT=GivenName
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:SurName CONTENT="SurName"
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:DOB
TAG POS=3 TYPE=TH ATTR=TXT:«
TAG POS=3 TYPE=TH ATTR=TXT:«
TAG POS=1 TYPE=SPAN ATTR=TXT:1900
TAG POS=1 TYPE=SPAN ATTR=TXT:Jul
TAG POS=2 TYPE=TD ATTR=TXT:01
TAG POS=1 TYPE=SELECT ATTR=NAME:Nationality CONTENT=%Brazil
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:Email CONTENT=teste@hotmail.com
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:EmailConfirm CONTENT=teste@hotmail.com
TAG POS=1 TYPE=SELECT ATTR=NAME:FamAppYN CONTENT=%No
TAG POS=1 TYPE=SELECT ATTR=NAME:PPNoYN CONTENT=%Yes
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:PPNo CONTENT=XY254966
TAG POS=1 TYPE=BUTTON ATTR=ID:btLook4App
TAG POS=1 TYPE=SELECT ATTR=NAME:AppSelectChoice CONTENT=%S

With this macro it fills the data, then I need Imacro to search for dates by pressing the button (Find appointment date). that was this way:

TAG POS=1 TYPE=BUTTON ATTR=ID:btSrch4Apps
TAG POS=1 TYPE=DIV ATTR=ID:maincontent
WAIT SECONDS=3

Each time you press the button, the message "No appointment (s) are currently available" appears, so that's the cat's leap! I need when this message does not appear that Imacro stops searching and rings an alarm so that it can manually do the scheduling. I need a macro just to keep searching.


Note: The data register is fixed, it fills once and it is saved for a period of time that I observed of 500 loops of macro 2 ai the page asks to be updated and the data needs to be filled again.

By the logic I need the Imacro:

1 - Fill in the data
2- Search for 500 loops
3- Update the page and restart steps 1 and 2
4- If the phrase "No appointment (s) are currently available" DO NOT appear, stop searching and ring an alarm

The macro for step 1 and 2 are already ready and working, but I do not know how to join the two and give the alarm condition.

Please help me!!!
I'm sorry for the bad English, because I'm using google translator! :lol: :lol:

I am using:
Ipswitch, Inc.
iMacros Browser (x86) Version 12.5.503.8802
Released on 11/05/2018
Licensed Product: Trial Version
License Type: 30-day trial (28 days left)

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

Re: Combine codes !!

Post by chivracq » Fri Nov 16, 2018 6:56 pm

gdsduarte wrote:My friend, thank you for responding!

I admit to being very lazy in Imacro!
I will thoroughly detail my situation here.

I need to schedule a visa and they have dates of the current day up to 60 days ahead, but the schedules in the system are very scarce and appear to the day, which is very difficult to keep updating all the time. :cry:

The site consists of completing a file and then searching the schedules. At first I made the macro 1 of the following form:

Code: Select all

VERSION BUILD=12.5.503.8802
TAB T=1
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 0.00
URL GOTO=https://burghquayregistrationoffice.inis.gov.ie/Website/AMSREG/AMSRegWeb.nsf/AppSelect?OpenForm
TAG POS=1 TYPE=SELECT ATTR=NAME:Category CONTENT=%Study
TAG POS=1 TYPE=SELECT ATTR=NAME:SubCategory CONTENT=%"English Language Course"
TAG POS=1 TYPE=SELECT ATTR=NAME:ConfirmGNIB CONTENT=%New
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=NAME:UsrDeclaration CONTENT=YES
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:GivenName CONTENT=GivenName
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:SurName CONTENT="SurName"
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:DOB
TAG POS=3 TYPE=TH ATTR=TXT:«
TAG POS=3 TYPE=TH ATTR=TXT:«
TAG POS=1 TYPE=SPAN ATTR=TXT:1900
TAG POS=1 TYPE=SPAN ATTR=TXT:Jul
TAG POS=2 TYPE=TD ATTR=TXT:01
TAG POS=1 TYPE=SELECT ATTR=NAME:Nationality CONTENT=%Brazil
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:Email CONTENT=teste@hotmail.com
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:EmailConfirm CONTENT=teste@hotmail.com
TAG POS=1 TYPE=SELECT ATTR=NAME:FamAppYN CONTENT=%No
TAG POS=1 TYPE=SELECT ATTR=NAME:PPNoYN CONTENT=%Yes
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:PPNo CONTENT=XY254966
TAG POS=1 TYPE=BUTTON ATTR=ID:btLook4App
TAG POS=1 TYPE=SELECT ATTR=NAME:AppSelectChoice CONTENT=%S
With this macro it fills the data, then I need Imacro to search for dates by pressing the button (Find appointment date). that was this way:

Code: Select all

TAG POS=1 TYPE=BUTTON ATTR=ID:btSrch4Apps
TAG POS=1 TYPE=DIV ATTR=ID:maincontent
WAIT SECONDS=3
Each time you press the button, the message "No appointment (s) are currently available" appears, so that's the cat's leap! I need when this message does not appear that Imacro stops searching and rings an alarm so that it can manually do the scheduling. I need a macro just to keep searching.


Note: The data register is fixed, it fills once and it is saved for a period of time that I observed of 500 loops of macro 2 ai the page asks to be updated and the data needs to be filled again.

By the logic I need the Imacro:

1 - Fill in the data
2- Search for 500 loops
3- Update the page and restart steps 1 and 2
4- If the phrase "No appointment (s) are currently available" DO NOT appear, stop searching and ring an alarm

The macro for step 1 and 2 are already ready and working, but I do not know how to join the two and give the alarm condition.

Please help me!!!
I'm sorry for the bad English, because I'm using google translator! :lol: :lol:

I am using:

Code: Select all

Ipswitch, Inc.
iMacros Browser (x86) Version 12.5.503.8802
Released on 11/05/2018
Licensed Product: Trial Version
License Type: 30-day trial (28 days left)
Thank you very much for your attention!
Ah...!!, this looks of much more interestingly better "Quality" than your first Post...! Excellent... :D

But OK, I have to "leave" now, I'll try to have a look at your Script/Case/Thread tomorrow or during the WE, this looks interesting now...

You could maybe in the meantime search the Forum on "visa+appointment", we had very recently (a few weeks ago => 2 or 3 months ago maybe...?) a very similar Thread on the Forum, for a different Site though... => + "spot+available+taken+free" were also Terms I/we used in the Thread... :idea:
Hum, can't find it directly... I had made or at least completely improved the Script for the User and made it configurable and where they could specify a Date and a (From) Time to select the available Appointments...
- (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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Combine codes !!

Post by chivracq » Sun Nov 18, 2018 5:43 am

OK, I read your 2nd Post with a little bit more "attention", well, you already run for 1st Macro until you reach the Appointment Screen and from there you'll be looping a separate Macro until the "No appointment (s) are currently available" Msg will disappear to trigger a "Conditional Sound". => Terms to use to search the Forum, I've already produced several Solutions for that...

If the Page needs a Refresh for the Msg to disappear, you'll need the 'EXTRACT' Mechanism to check for that Field to be present or not.
Would any other Field/Msg appear or some Element suddenly become visible or enabled without the need for a Refresh, you could simply use a very long '!TIMEOUT_STEP' before tagging/extracting that Element and the Script will simply wait until it appears...

If you lose your Session after say 1 Hour for example, you can set the '!TIMEOUT_STEP' to 3600 Sec before triggering the Sound, there is even no need to make the Sound Conditional, you'll know that you need to re-fill all the Fields anyway with the 1st Macro..., and if no Refresh is needed, you can also directly include that part to the same 1st Macro, there is then no need for a separate Macro if no Looping is needed...

Same Principle can also be used for a "Conditional PROMPT"... :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...
Post Reply