iMacros on New Tabs

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
jrtrev1
Posts: 2
Joined: Wed Nov 16, 2016 12:54 pm

Re: iMacros on New Tabs

Post by jrtrev1 » Wed Nov 16, 2016 5:08 pm

I see exactly what you mean.. hmm I will continue to test.
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: iMacros on New Tabs

Post by iimfun » Fri Nov 18, 2016 8:02 am

You can move to the last tab like so

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
or to the 1st, 2nd, ..., 8th tab by replacing "9" with "1", "2", ..., "8", respectively.

In order to solve more complex tasks I would use 'gBrowser' in js scripts for Firefox.
Hemingway
Posts: 22
Joined: Wed Oct 17, 2012 12:40 pm

Re: iMacros on New Tabs

Post by Hemingway » Fri Nov 18, 2016 9:58 am

Thank you so very much for your helpful contribution. Actually it opens up a wide range of unknown opportunities for me, since it allows to implement keyboard shortcuts into imacros. Very clever!

[added a little later:]
After a bit of experimenting I've encountered the usual little problems ...
This is PageUp and works perfectly:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=33
Why does this NOT produce Ctrl+PageUp (i.e., move one tab to the left in Firefox)?

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=33 MODIFIERS="ctrl"
Downgraded from VERSION BUILD=9030808 to VERSION BUILD=8970419
Windows 10 (64-Bit) German latest build
Firefox Portable 55.0 (32-Bit)
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros on New Tabs

Post by chivracq » Fri Nov 18, 2016 7:01 pm

Hemingway wrote:Thank you so very much for your helpful contribution. Actually it opens up a wide range of unknown opportunities for me, since it allows to implement keyboard shortcuts into imacros. Very clever!

[added a little later:]
After a bit of experimenting I've encountered the usual little problems ...
This is PageUp and works perfectly:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=33
Why does this NOT produce Ctrl+PageUp (i.e., move one tab to the left in Firefox)?

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=33 MODIFIERS="ctrl"
Well, might be handy if you mentioned in which FCI you tested..., because:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=33 MODIFIERS="ctrl"
- WORKS in: iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.
- DOESN'T WORK (does nothing) in: iMacros for FF v8.9.7, FF47, Win10-x64.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Hemingway
Posts: 22
Joined: Wed Oct 17, 2012 12:40 pm

Re: iMacros on New Tabs

Post by Hemingway » Fri Nov 18, 2016 11:00 pm

I'm very sorry, of course I should have stated this right at the beginning. Thanks for reading the question anyway, and even more for answering!

- iMacros for FF v9.0.3
- FF 50.0
- Win10-x64 1607 (Build 14393.447)
- The test script is just this one line.

Your info ...
- WORKS in: iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.
- DOESN'T WORK (does nothing) in: iMacros for FF v8.9.7, FF47, Win10-x64.
... conveys the impression to me that the function has somehow gone lost in the course of updates and may return (be fixed) with some future version. In this case, patience helps ...
Downgraded from VERSION BUILD=9030808 to VERSION BUILD=8970419
Windows 10 (64-Bit) German latest build
Firefox Portable 55.0 (32-Bit)
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros on New Tabs

Post by chivracq » Sat Nov 19, 2016 12:39 am

Hemingway wrote:I'm very sorry, of course I should have stated this right at the beginning. Thanks for reading the question anyway, and even more for answering!

Code: Select all

- iMacros for FF v9.0.3
- FF 50.0
- Win10-x64 1607 (Build 14393.447)
- The test script is just this one line.

Your info ...
- WORKS in: iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.
- DOESN'T WORK (does nothing) in: iMacros for FF v8.9.7, FF47, Win10-x64.
... conveys the impression to me that the function has somehow gone lost in the course of updates and may return (be fixed) with some future version. In this case, patience helps ...
Yep, if it's "already" broken in v8.9.7, then I'm not too surprised that it doesn't work in v9.0.3 either as this Bug has never been reported before afaik...
We have a few Users on the Forum using v8.8.7 (+ PM v26.5.0), hopefully one will notice this Thread and will mention how v8.8.7 behaves..., even if hum..., that won't really help to solve the Issue for v8.9.7 or v9.0.3, ah-ah...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Hemingway
Posts: 22
Joined: Wed Oct 17, 2012 12:40 pm

Re: iMacros on New Tabs

Post by Hemingway » Sat Nov 19, 2016 10:03 am

Well then ... this is not good news, but not uncommon.
So I thought I might at least find out and use the things that DO work.

- downgraded to iMacros for FF v8.9.7 (oldest version in my reach; everything I need used to work fine then)
- FF 50.0
- Win10-x64 1607 (Build 14393.447)

1. tried login macro on my own website => still works perfectly:

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
SET !TIMEOUT_STEP 0
TAB OPEN
SET !ERRORIGNORE YES
TAB T=1
TAB T=2 [3-4-5 etc.]
TAB T=9
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 6

URL GOTO=https://www.myownpage.com/   ' page loads perfectly!
TAG POS=1 TYPE=A ATTR=TXT:Start
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Login
[etc., enter passwords ... login successful]
2. replaced ONLY the TAB opening procedure => does NOT work any longer:

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
TAB OPEN
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"

URL GOTO=https://www.myownpage.com/   ' page still loads perfectly!
TAG POS=1 TYPE=A ATTR=TXT:Start
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Login
[etc., enter passwords ...]
Error message: "RuntimeError: element A specified by TXT:Start was not found, line 24 (Error code: -921)"

WHY DOES the macro find the Start button after the first TAB opening procedure, but NOT after the "EVENT" commands?
Downgraded from VERSION BUILD=9030808 to VERSION BUILD=8970419
Windows 10 (64-Bit) German latest build
Firefox Portable 55.0 (32-Bit)
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros on New Tabs

Post by chivracq » Sat Nov 19, 2016 1:18 pm

Hemingway wrote:Well then ... this is not good news, but not uncommon.
So I thought I might at least find out and use the things that DO work.

- downgraded to iMacros for FF v8.9.7 (oldest version in my reach; everything I need used to work fine then)
- FF 50.0
- Win10-x64 1607 (Build 14393.447)

1. tried login macro on my own website => still works perfectly:

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
SET !TIMEOUT_STEP 0
TAB OPEN
SET !ERRORIGNORE YES
TAB T=1
TAB T=2 [3-4-5 etc.]
TAB T=9
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 6

URL GOTO=https://www.myownpage.com/   ' page loads perfectly!
TAG POS=1 TYPE=A ATTR=TXT:Start
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Login
[etc., enter passwords ... login successful]
2. replaced ONLY the TAB opening procedure => does NOT work any longer:

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
TAB OPEN
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"

URL GOTO=https://www.myownpage.com/   ' page still loads perfectly!
TAG POS=1 TYPE=A ATTR=TXT:Start
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Login
[etc., enter passwords ...]
Error message: "RuntimeError: element A specified by TXT:Start was not found, line 24 (Error code: -921)"

WHY DOES the macro find the Start button after the first TAB opening procedure, but NOT after the "EVENT" commands?
Yep, using iMacros for FF v8.8.2, I can reproduce indeed using the following Script which uses Pages from the Forum as I don't have your "myownpage" whatever...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !SINGLESTEP YES
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
TAB OPEN
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"

URL GOTO=http://forum.imacros.net
TAG POS=1 TYPE=A ATTR=TXT:iMacros<SP>for<SP>Firefox
I run this Script in a PM (= Pale Moon) Instance with already 4 Tabs open, running the Script from TAB_1...
=> It jumps to TAB_4, opens a New Tab, jumps to it (= TAB_5), loads the Main Forum Page in TAB_5, and fails at clicking on the Link to open the FF Sub-Forum.

BUT...!!, the good News is that you have discovered a VERY interesting Bug, ah-ah...!, which opens quite some doors for some interesting "things", ah-ah...!! :twisted:

Because if you now run the same Script again, with 5 Tabs instead of 4 Tabs previously, and the Forum Page already loaded in TAB_5, you still launch the Script from TAB_1:
=> It jumps to TAB_5, opens a New Tab, jumps to it (= TAB_6), loads the Main Forum Page in TAB_6, and... clicks "silently" on the Link to open the FF Sub-Forum not in TAB_6 but in TAB_5...! The Focus is still on TAB_6 but if you manually go to TAB_5, you will notice that the Link was clicked in that Tab... (And you didn't get the RuntimeError anyway.)

If you run the Script and you have the iMacros Main Forum Page already loaded in TAB_1, you add a "TAB T=1" after the "TAB OPEN" and then you jump to the last Tab where you open the Forum Page, the FF Sub-Forum Link will then be clicked/opened in TAB_1, ah-ah...!

I can reproduce as well with 'KEY=33(PgUp='TAB=R-1')/34(PgDn='TAB=R1') MODIFIERS="Ctrl"', the 'URL GOTO' is able to keep track of the current active Tab, while any 'TAG' Statement will try to execute in the previous Tab iMacros was on before switching to another Tab using the 'EVENT' Mode.
It is definitely a Bug in my Opinion, but it opens some interesting doors to me, in terms of "doing things" "silently" in one Tab while apparently doing "other things" visibly in another Tab...

And I've got another Good News, ah-ah...! I found you an easy Workaround: 8)

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'SET !SINGLESTEP YES
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
TAB OPEN
TAB OPEN
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="9" MODIFIERS="ctrl"
TAB CLOSE

URL GOTO=http://forum.imacros.net
TAG POS=1 TYPE=A ATTR=TXT:iMacros<SP>for<SP>Firefox
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Hemingway
Posts: 22
Joined: Wed Oct 17, 2012 12:40 pm

Re: iMacros on New Tabs

Post by Hemingway » Wed Nov 23, 2016 5:17 pm

Oh dear ... well, so all those black holes turn out to be open doors, isn't that something ...
I'm glad you could reproduce my problem(s) and identify the bugs as such. Thanks for your precise explanations - on such a basis it shouldn't be impossible for the guys at imacros to correct the bugs some day. Should I report them anywhere?
And I'm very happy about your workaround. It works fine under 8.9.7, and even under 9.0.3!
Thanks a lot!!!!
Downgraded from VERSION BUILD=9030808 to VERSION BUILD=8970419
Windows 10 (64-Bit) German latest build
Firefox Portable 55.0 (32-Bit)
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iMacros on New Tabs

Post by chivracq » Wed Nov 23, 2016 5:55 pm

Hemingway wrote:Oh dear ... well, so all those black holes turn out to be open doors, isn't that something ...
Ah-ah...!, yep, it's actually a cool and freaky "Feature", to be able to silently have a Macro interact with a Tab that doesn't even have the Focus, this Functionality has been requested several times already and it was supposed to be "impossible" to implement, ah-ah...!
I am "nearly sad" that v8.8.2, the Version I use personally (on Pale Moon v26.3.3), is not impacted, ah-ah...! But OK, if I find the time and energy, I will have a look at the Core-Code of the Add-on (on FF) to try to identify what was changed between v8.8.2 and v8.9.7 (I've asked sbd in some other active Thread, using v8.8.7, if they could test in that Version but they couldn't be bothered, only interested for their own Issue, grrr...!) and I might then add this Functionality to my own Add-on, possibly with some Toggle-Switch, I've already "customized" my "own" Add-on a few times, always funny ah-ah...!
Hemingway wrote:I'm glad you could reproduce my problem(s) and identify the bugs as such. Thanks for your precise explanations - on such a basis it shouldn't be impossible for the guys at imacros to correct the bugs some day. Should I report them anywhere?
And I'm very happy about your workaround. It works fine under 8.9.7, and even under 9.0.3!
Thanks a lot!!!!
About reporting this Bug "somewhere", the Forum is good enough "normally", unless you have a Support License, then 'Support Tickets' reported by paying Customers weigh a bit more than Bugs reported on the Forum, and I will list it as well in some "dedicated" Thread where I keep Track of all Bugs related to the 'EVENT' Mode and maintain a List of "interesting" Threads about the 'EVENT' Mode...:
- Feedback and Issues on EVENT Recording Mode.
Haven't updated the Thread since a while btw, hum, OK, for my "ToDo List", ah-ah...!

To anybody else jumping onto the Thread, it would still be interesting to know if the following FCI's supporting the 'EVENT' Mode show the same Bug/Behaviour:
- iMacros for FF v8.8.7 (+ any Versions between v8.8.2 and v8.9.7).
- iMacros for IE11 + iMB11 v11.
- iMacros for CR v8.4.4.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply