Help with browser script.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Help with browser script.

Post by NewScriptee » Wed Mar 09, 2011 5:03 pm

I have been trying my hardest to figure out the missing pieces in this macro...

I cannot figure out how to add the window event trigger.

Basically it should wait until the google chrome crashes (and it will) and once the crash box appears, restart it and restore the page automatically, then go back into monitor mode...

I recorded the strokes via recorder and i thought it would be simple as adding the window trigger via properties but no luck there what am I missing here?

//12\ChromeAssure27.scp
// Recorded on Sunday, March 6, 2011, at 02:59 PM

//Recorded Events
Let>WW_TIMEOUT=5
CapsOff
WaitWindowOpen>Workspace Macro Pro - Automation Edition
MoveWindow>Workspace Macro Pro - Automation Edition,604,2
ResizeWindow>Workspace Macro Pro - Automation Edition,800,533
MouseMove>734,574
Wait>3.61
LDown
WaitWindowOpen>Google Chrome
MoveWindow>Google Chrome,530,452
ResizeWindow>Google Chrome,347,145
Wait>0.14
LUp
WaitWindowOpen>New Tab - Google Chrome
MoveWindow>New Tab - Google Chrome,-3,421
ResizeWindow>New Tab - Google Chrome,1402,576
Wait>2.63
MouseMove>677,517
Wait>1.93
LClick
WaitWindowOpen>Blogspot - Google Chrome
MoveWindow>Blogspot - Google Chrome,-3,421
ResizeWindow>Blogspot - Google Chrome,1402,576
Wait>3.73
MouseMove>671,477
Wait>9.93
LClick
Wait>4.36
Press Backspace

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

Post by Marcus Tettmar » Wed Mar 09, 2011 5:30 pm

I'm not sure what you are trying to achieve. It may help to just explain what you want to do. Your script just appears to wait for some windows to appear and then press keys like Up. Why would this cause Chrome to crash? What window are you wanting to set up a trigger for?

Maybe go back to basics, show us some screenshots and instead of posting a script explain the process you are following, the keys you need to press and the outcome you are looking for.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Wed Mar 09, 2011 6:31 pm

no the macro doesn't cause chrome to crash, i want it to start up when chrome crashes,

When chrome crashes a dialogue box appears asking you to restart? you click yes, it restarts then it ask you to restore lest session, so that is another click. the backspace just clears whatever was in the URL address bar.

For some reason though when the browser crashes the macro isn't starting.

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

Post by Marcus Tettmar » Wed Mar 09, 2011 6:53 pm

Please send a screenshot of the message that appears when Chrome crashes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Wed Mar 09, 2011 6:57 pm


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

Post by Marcus Tettmar » Wed Mar 09, 2011 7:04 pm

Could you send a capture showing the first window in full, so that we can see the window title.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Wed Mar 09, 2011 7:36 pm


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

Post by Marcus Tettmar » Wed Mar 09, 2011 7:47 pm

So it looks like you want your trigger settings as follows:

Trigger Type: Window Event
Trigger: Window Opened
Window Title: Google Chrome
Only When Visible: Checked

Now this assumes there is no other window precisely entitled "Google Chrome" already on the system that is visible.

I have Chrome but I can't find a way to make it crash, nor have I seen it crash for months, so I'm not sure how I can test it out.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Wed Mar 09, 2011 8:25 pm

isn't there suppose to be macro result and macro true false?

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Thu Mar 10, 2011 12:11 am

did that and again still doesn't trigger the macro...

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Thu Mar 10, 2011 12:56 am

okay i set it to run, now when the box appears it just gives the error:

Cannot focus a disabled or invisible window.

which is odd because if i click the button manually for chrome the macro will recognize the next step just not the first yet any suggestions?

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Thu Mar 10, 2011 5:21 pm

OKAY it turned out to be much simpler:

WaitWindowOpen>Google Chrome
SetFocus>Google Chrome
Press Enter
WaitWindowOpen>New Tab - Google Chrome
SetFocus>New Tab- Google Chrome
Wait>2
Mousemove>662,493
LClick



Now the only problem i have is that once it completes it turns off the macro how can i make it go back to a monitor state?

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

Post by Marcus Tettmar » Thu Mar 10, 2011 5:26 pm

You can use the trigger settings. Or you can use a loop.

1. Using the trigger settings:

In macro properties, click on Triggers then set the trigger up as I suggested previously:

Trigger Type: Window Event
Trigger: Window Opened
Window Title: Google Chrome
Only When Visible: Checked

2. Using a continually looping script:

Change your code as follows:

Code: Select all

Label>start
WaitWindowOpen>Google Chrome 
SetFocus>Google Chrome 
Press Enter 
WaitWindowOpen>New Tab - Google Chrome 
SetFocus>New Tab- Google Chrome 
Wait>2 
Mousemove>662,493 
LClick
Wait>0.2
Goto>start
And then set the macro to run on startup in macro properties run when settings.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

NewScriptee
Newbie
Posts: 11
Joined: Sun Mar 06, 2011 11:06 pm

Post by NewScriptee » Thu Mar 10, 2011 5:34 pm

yeah i found it out on another post in the forum the loop part tried it and YES it works!!!

I'm sold on the product....will be purchasing today!!

Thanks for the support you just saved me countless hours of downtime

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