Troubles with javascript and flash

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

Troubles with javascript and flash

Post by fthomas » Wed Nov 04, 2009 4:03 am

Good day,

I'm trying to create a script to post to my favorite article directories, but to make things cleaner and more application like on their submissions pages, many article directories are resorting to using javascript and flash controls.

Now, my question is, what is the cleanest way to access and work with those winrecorder undetectable controls?

I've thought about keystrokes, but that doesn't seem to work. When inputting data with winrecorder pulling form data, it doesn't seem to leave focus on the last control. If it did, it would be a slam dunk. I could send tabs to the page to put the cursor in the correct position.

Also, some pages will present a captcha code. I'd like the script to detect the presence of the captcha and display it in a dialog box for me to give it the code and send that code to the page.

Any ideas for a stuck automator? :(

Frank

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Nov 04, 2009 9:04 am

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

Post by fthomas » Mon Nov 09, 2009 10:06 pm

Thanks for your reply Marcus. One question regarding the image recognition.

How do I choose the click spot within the image. For example, if I get an image where they have to click in the bottom right hand corner, how could I set that up?

Thanks,

Frank

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 10, 2009 11:40 am

FindImagePos can be set to return either the top left position or the centre. You know the size of the image since you captured it (Windows Explorer or Paint will tell you the dimensions). So you can easily calculate any desired offset you like. If your image was 10x10 chars and you wanted to click in 9,9 then have FIP return top left and simply add 9 to the X and Y values returned.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

Post by fthomas » Tue Nov 10, 2009 3:31 pm

mtettmar wrote:FindImagePos can be set to return either the top left position or the centre. You know the size of the image since you captured it (Windows Explorer or Paint will tell you the dimensions). So you can easily calculate any desired offset you like. If your image was 10x10 chars and you wanted to click in 9,9 then have FIP return top left and simply add 9 to the X and Y values returned.
Thanks Marcus,

After I get the correct position, would I then do a mouse click to set the cursor and then send the appropiate characters? I'm interested in automating this as a background job, so would this be still possible?

Frank

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 10, 2009 3:38 pm

Yes, you would use MouseMove and the LClick.

GUI automation cannot ever be done in the background.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts