How to use event in javascript?

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
Post Reply
lumer8
Posts: 17
Joined: Tue Sep 02, 2014 3:15 am

How to use event in javascript?

Post by lumer8 » Wed Feb 18, 2015 4:27 pm

Im wondering is it possible to use event mode with javascript, i keep getting an error.

Code: Select all

var macro;
macro =  "CODE:";
macro +=  "SET !ERRORIGNORE YES" + "\n"; 
macro +=  "URL GOTO=google.com/" + "\n"; 
macro +=  "WAIT SECONDS=2" + "\n"; 
macro +=  "EVENTS TYPE=KEYPRESS SELECTOR="#lst-ib" CHARS="make money online"" + "\n"; 
macro +=  "WAIT SECONDS=2" + "\n";  
iimPlay(macro);
8.6.0 , windows 8, firefox32
chivracq
Posts: 9430
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to use event in javascript?

Post by chivracq » Thu Feb 19, 2015 2:51 am

lumer8 wrote:Im wondering is it possible to use event mode with javascript, i keep getting an error.

Code: Select all

var macro;
macro =  "CODE:";
macro +=  "SET !ERRORIGNORE YES" + "\n"; 
macro +=  "URL GOTO=google.com/" + "\n"; 
macro +=  "WAIT SECONDS=2" + "\n"; 
macro +=  "EVENTS TYPE=KEYPRESS SELECTOR="#lst-ib" CHARS="make money online"" + "\n"; 
macro +=  "WAIT SECONDS=2" + "\n";  
iimPlay(macro);
8.6.0 , windows 8, firefox32
"... i keep getting an error." => Yep, very vague...! Which Error...?

I'm a bit surprised about your Config, there were some big Changes in FF30 and FF31 that more or less completely broke iMacros for FF v8.8.2 (> v8.6.0), which forced Development to release v8.8.3/4/5, v8.8.5 was the first Version a bit stable, current Version is v8.8.8, that should be your Version on FF32, even if you could update FF to FF35 as well...

First convert your .js on the Fly Macro to a plain .iim Macro to check if it works first in your Configuration, then update iMacros to v8.8.2 and v8.8.8...
- (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...
janib4all
Posts: 132
Joined: Wed Jul 21, 2010 6:44 am
Location: Karachi, Sindh, Pakistan
Contact:

Re: How to use event in javascript?

Post by janib4all » Thu Feb 19, 2015 12:13 pm

Yes, it is possible. Save it to something.js and hit play:

Code: Select all

var macro;
macro =  "CODE:";
macro +=  "SET !ERRORIGNORE YES\n"; 
macro +=  "URL GOTO=google.com\n"; 
macro +=  "WAIT SECONDS=2\n"; 
macro +=  "EVENTS TYPE=KEYPRESS SELECTOR=\"#lst-ib\" CHARS=\"make money online\"\n"; 
macro +=  "WAIT SECONDS=2\n"; 

iimPlay(macro);]
Hire the BoT-fReeak!
botspecialist.blogspot.com
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: How to use event in javascript?

Post by techimac » Mon Apr 11, 2016 6:51 pm

Thanks.
I needed solution and came across thread using google.
Post Reply