Legalien wrote: ↑
Wed Apr 01, 2020 6:53 pm
I am looking for a way to pause an iMacro script until the current tab is manually closed, at which point I want the iMacro to continue working (without me having to click continue).
So here is the scenario.
iMacro starts and loads page
iMacro jumps to Tab 2
iMacro pauses after 60 seconds
After some time tab 2 is closed by user
iMacro continues to work on Tab 1
The reason I need this, well, there is this website where Tab 1 will "expire" some seconds after Tab 2 is closed. And the amount of time I need to spend on Tab 2 is always different, so having a set amount of seconds that iMacro stay on Tab 2 creates problems for me.
Simply put, I need a command so that my script:
Click go Tab 2
PAUSE until tab 2 is closed...
...at some point the user manually closes tab 2...
iMacro script continues to work automatically as soon as tab 2 is closed.
Not sure if possible. Is it?
1. Jump to Tag 2
2. Use 15 seconds as compulsory wait using WAIT SECONDS=15
3. Then, keep checking the URL of the current tab every half a second.
4. If the URL of the current tab changes, it means the user has closed the tab.
I am sharing the code that will "pause" the script until the user manually closes the tab.
Code: Select all
var tabURL = window.location.toString();
Code: Select all
alert("Please close the tab");
// Code that runs on Tab 1
I have added a wait of 3 seconds because I assume the user can manually close the tab within 3 seconds.
I assume that you want the closing of the tab to be automated too. I can't seem to find the exact use case. If you can share that, I might be able to help you automate closing the tab automatically too.
I hope it helps
Robust iMacros development with quick turnaround time. Drop an email at "email@example.com" with your project details.