Imacro to reply to a mail in gmail

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
Post Reply
regstuff
Posts: 6
Joined: Sun Jun 17, 2018 10:52 am

Imacro to reply to a mail in gmail

Post by regstuff » Wed Nov 07, 2018 1:16 pm

FCI: Firefox 49.0b2-64bit, iMacros 9.0.3, Windows 10-64 bit

Trying to create a macro that will open gmail (login info is saved in the browser), search for a particular phrase "VP-2422", then click the topmost result, and reply to that mail with a standard text. I've managed to do everything listed, including clicking the reply button. But I'm unable to fill the reply textbox with the text. Not having much luck figuring out the ATTR elements to use to fill in the textbox. My code currently is below. I've added WAIT SECONDS=10 every once in a while because gmail seems to take some time to load some elements and the macro was timing out. ANy help is much appreciated.

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://mail.google.com/

'ENTER TEXT INTO SEARCH FIELD
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aso_search_form_anchor ATTR=NAME:q CONTENT=VP-2422
WAIT SECONDS=10

'CLICK THE MAGNIFYING GLASS FOR SEARCH
TAG POS=1 TYPE=BUTTON FORM=ID:aso_search_form_anchor ATTR=ARIA-LABEL:Search<SP>Mail*
WAIT SECONDS=10

'CLICK ON THE FIRST MAIL
TAG POS=2 TYPE=SPAN ATTR=TXT:VP-2422*
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=ID::nv
WAIT SECONDS=10

'THIS IS THE BIT WHERE I'M TRYING TO ADD TEXT INTO THE REPLY BOX.
TAG POS=1 TYPE=DIV ATTR=CLASS:gmail_default CONTENT=TEST<SP>TEST
chivracq
Posts: 8141
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacro to reply to a mail in gmail

Post by chivracq » Wed Nov 07, 2018 9:34 pm

regstuff wrote:FCI:

Code: Select all

Firefox 49.0b2-64bit, iMacros 9.0.3, Windows 10-64 bit
Trying to create a macro that will open gmail (login info is saved in the browser), search for a particular phrase "VP-2422", then click the topmost result, and reply to that mail with a standard text. I've managed to do everything listed, including clicking the reply button. But I'm unable to fill the reply textbox with the text. Not having much luck figuring out the ATTR elements to use to fill in the textbox. My code currently is below. I've added WAIT SECONDS=10 every once in a while because gmail seems to take some time to load some elements and the macro was timing out. ANy help is much appreciated.

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://mail.google.com/

'ENTER TEXT INTO SEARCH FIELD
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aso_search_form_anchor ATTR=NAME:q CONTENT=VP-2422
WAIT SECONDS=10

'CLICK THE MAGNIFYING GLASS FOR SEARCH
TAG POS=1 TYPE=BUTTON FORM=ID:aso_search_form_anchor ATTR=ARIA-LABEL:Search<SP>Mail*
WAIT SECONDS=10

'CLICK ON THE FIRST MAIL
TAG POS=2 TYPE=SPAN ATTR=TXT:VP-2422*
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=ID::nv
WAIT SECONDS=10

'THIS IS THE BIT WHERE I'M TRYING TO ADD TEXT INTO THE REPLY BOX.
TAG POS=1 TYPE=DIV ATTR=CLASS:gmail_default CONTENT=TEST<SP>TEST
Yeah, a 'DIV' is not an 'INPUT' Element for the 'TAG' Mode afaik, or put in other words: the 'CONTENT' Parameter only works for Elements that the 'TAG' Mode "identifies" as 'TYPE=INPUT' Elements, by Design I think, that part of the "Core Code" of iMacros has never changed I think since the 1st Version of iMacros, more than 10 years ago...), you may want to use the 'EVENT' Mode for that part, which usually works better for such Pages... (and that kind of editable 'DIV' Elements...) :idea:

Another "Idea" would be to use the Gmail "Classic HTML" View which has a more "straightforward" HTML Structure for the Page and no real-time JS Scripts running (and dynamically) changing the Content (and the Structure) of the Page... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
regstuff
Posts: 6
Joined: Sun Jun 17, 2018 10:52 am

Re: Imacro to reply to a mail in gmail

Post by regstuff » Fri Nov 09, 2018 9:38 am

Well thanks. After playing around with the various recording options, I just switched to basic html. Much more straightforward. :D
chivracq
Posts: 8141
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacro to reply to a mail in gmail

Post by chivracq » Fri Nov 09, 2018 10:19 am

regstuff wrote:Well thanks. After playing around with the various recording options, I just switched to basic html. Much more straightforward. :D
Yep, very good... :D , would have been my first Choice also I think, for Reliability-sake, the 'EVENT' Mode would work also on the "Full" View, but pfff, might get broken regularly through all Changes Gmail undergoes regularly, and if you receive some Chat or Circles or Google+ Msg/Notification or whatever gets pushed to your Screen... :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply