How to close the iMacros Browser?
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
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
-
- Posts: 3
- Joined: Mon May 26, 2014 6:18 am
How to close the iMacros Browser?
Hello,
I need to close the iMacro Browser (the .exe) and TAB CLOSE only closes a TAB,
what options do I have within the macro function (not iimExit())?
If there is no propper function ( I tried to google for it ) i'd go with something like send: ALT F4
Thank you in advance for support
I need to close the iMacro Browser (the .exe) and TAB CLOSE only closes a TAB,
what options do I have within the macro function (not iimExit())?
If there is no propper function ( I tried to google for it ) i'd go with something like send: ALT F4
Thank you in advance for support
Re: How to close the iMacros Browser?
FCIM...!Roy Holzem wrote:Hello,
I need to close the iMacro Browser (the .exe) and TAB CLOSE only closes a TAB,
what options do I have within the macro function (not iimExit())?
If there is no propper function ( I tried to google for it ) i'd go with something like send: ALT F4
Thank you in advance for support
-1- First thought I had is to launch your (Browser and) Script from a Batch File and to issue a 'taskkill' once your Script has finished running. (This should work...)
-2- Second thought was indeed to simulate a Keypress with ALT^F4.
In iMacros for Firefox, you should be able to use the EVENT Mode with one of these Statements:
Code: Select all
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY" KEY=115 MODIFIERS="alt"
Code: Select all
EVENT TYPE=KEYPRESS SELECTOR=* KEY=115 MODIFIERS="alt"
Code: Select all
EVENT TYPE=KEYPRESS KEY=115 MODIFIERS="alt"
Even after I checked/modified 'dom.allow_scripts_to_close_windows' to "TRUE" in 'about:config'...
I don't know why, because the following Statements do work fine:
Code: Select all
'Toggle Full Screen (F11):
EVENT TYPE=KEYPRESS KEY=122
Code: Select all
'Browse Open Archives (Alt^m):
EVENT TYPE=KEYPRESS CHAR="m" MODIFIERS="alt"
=> How to simulate a keypress using Javascript
-3- The third thought was to use some JavaScript, and Google took me to this Page:
=> How can I close a browser window without receiving the “Do you want to close this window” prompt?
Several Methods explained, but "window.close()" will only close a Window that was opened by JavaScript...
The Function I retained is:
Code: Select all
this.focus();
self.opener=this;
self.close();
Code: Select all
javascript:this.focus();self.opener=this;self.close()
But how can I invoke the Web Console from iMacros? It luckily has a Shortcut (Ctrl^Shift^j) and indeed, using the EVENT Mode again, I manage to launch it and a Paste of that Statement in the Clipboard should do the trick. But I didn't manage to get the Paste to work. I give my Script for Reference, but it didn't work:
Code: Select all
SET !CLIPBOARD "javascript:this.focus(); self.opener=this; self.close()"
PROMPT {{!CLIPBOARD}}
'Launch Firefox Web Console:
EVENT TYPE=KEYPRESS CHAR="k" MODIFIERS="ctrl,shift"
WAIT SECONDS=3
'Paste Clipboard Content:
EVENT TYPE=KEYPRESS CHAR="v" MODIFIERS="ctrl"
'Hit ENTER:
EVENT TYPE=KEYPRESS KEY=13
-4- Now the fourth thought, which proved to be successful, is simply to use!:
Code: Select all
URL GOTO=javascript:this.focus();self.opener=this;self.close()
Tested on iMacros v8.8.2 for FF on Pale Moon v24.5.0 (=FF29) on WinXP SP3.
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 3
- Joined: Mon May 26, 2014 6:18 am
Re: How to close the iMacros Browser?
Hello chivracq,
Thank you very much for your propositions, I got it to work with a timed ALT F4.
Impressive response though
Best regards
Thank you very much for your propositions, I got it to work with a timed ALT F4.
Impressive response though
Best regards
Re: How to close the iMacros Browser?
Okay, but I don't understand what you mean by "a timed ALT F4"... Can you explain? (And post your Script if some Code is required...?)Roy Holzem wrote:Hello chivracq,
Thank you very much for your propositions, I got it to work with a timed ALT F4.
Impressive response though
Best regards
The 'URL GOTO' Solution is quite powerful btw, I think..., but I've tested it only on Pale Moon (= Firefox), I would be interested to know if it works as well for other Browsers, among them for the iMacros Browser... Could you test that...?
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: How to close the iMacros Browser?
Pity you never replied anymore to my last Post...
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: How to close the iMacros Browser?
Other relevant Threads:
- Batch File: Load Firefox, Run Macro(s), Close
- Any way of writing a macro that closes the entire browser?
- Unable to close Firefox (Aug.2016 - Feb.2017) + 'Ctrl^Shift^w' + VM + FF/PM.
(Last Update: 2017-02-04.)
- Batch File: Load Firefox, Run Macro(s), Close
- Any way of writing a macro that closes the entire browser?
- Unable to close Firefox (Aug.2016 - Feb.2017) + 'Ctrl^Shift^w' + VM + FF/PM.
(Last Update: 2017-02-04.)
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: How to close the iMacros Browser?
Some Update on this Syntax, as my original Post was already from more than 4 years ago, ah-ah...!chivracq wrote:-4- Now the fourth thought, which proved to be successful, is simply to use!:If several Tabs are open, only the current Tab is closed, you may need to loop/repeat that Statement a few times if you want to make sure to close the Last Tab (and the Window with it) if you have several Tabs open...Code: Select all
URL GOTO=javascript:this.focus();self.opener=this;self.close()
Tested on iMacros v8.8.2 for FF on Pale Moon v24.5.0 (=FF29) on WinXP SP3.
I not funnily at all (as hardly any new Functionality was added to iMacros for FF, on the contrary actually, all later Versions especially v9.0.3 and v10.0.2 were/are very limited (and buggy), compared to v8.8.2 and later v8.9.7 which is OK) still use the same iMacros for FF Version: v8.8.2, ah-ah...!
=> This Syntax to close a Tab (and the Browser Instance if it's the last Tab), and which can easily be used for a "Conditional CLOSE", still works in the following FCI's:
- iMacros for FF v8.8.2, Pale Moon v26.3.3_x32 (=FF47), Win10_x64.
- iMacros for FF v8.9.7, FF v55.0.3_x32, Win10_x64.
It doesn't seem to work anymore in:
- iMacros for FF v10.0.2.1450 'Free', FF v62.0_x64 (Portable), Win10_x64.
(I also tested with v10.0.2.1440 (Beta) + FF v61.0.1_x64 (Portable), same Result...)
=> The Script runs, but it does nothing, no Error...
But hum, I'm running FF62 Portable a bit "out-of-the-Box", I didn't tune its 'about:config' at all, (as I don't use this Browser at all, because of all Limitations with v10.0.2 ('Free'), I had only installed it for the v10.0.2 Beta-Testing Phase), and I think I remember that some "Allow-JavaScript-to-close-Tabs/Windows" Setting was needed..., hum, that could play a role...!
=> Yep, found it: 'dom.allow_scripts_to_close_windows' (='default' ='false') => I toggle it to 'true'...
And yep indeed, that makes a Difference...! I can close a Tab...!
But hum..., it works "half"...! That Line is able to close the current Tab indeed, but the Script then hangs on that Line, 'Pause'/'Resume' does nothing, I can only 'Stop' the Macro. (I made sure the "next" Tab is opened on some "normal" 'http'/'https' Web-Page, no 'about:xxx' whatever Pages which are now a big pain in the ass with v10.0.2... )
But if the "Purpose" is to close the Browser Instance, so if there is only 1 Tab in that FF Instance (after a 'TAB CLOSEALLOTHERS' for example), then it still "does the job"...! (and the Window is closed.)
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...