Internet URL

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jkukuda
Newbie
Posts: 6
Joined: Mon Nov 24, 2008 2:45 am

Internet URL

Post by jkukuda » Mon Nov 24, 2008 2:51 am

I am trying to copy the url from one Explorer window to a URL box in another program.

SetFocus>HCSO Arrests - Windows Internet Explorer
Wait>0.68
GetTextAtPoint>423,232,strText,nCharPos
SetFocus>Alpha Five - [SearchEngine]
GetCaretPos>X,Y,0
MouseMove>x,y
Wait>1.86
strTextSend Character/Text>strText
MessageModal>%strtext%


The modal message dosen't show aanything. What am I missing?

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

Post by Marcus Tettmar » Mon Nov 24, 2008 10:08 am

Make your life simpler: ALT+D puts keyboard focus in the address bar, so, all you need to do is:


//Focus IE
SetFocus>HCSO Arrests - Windows Internet Explorer

//Press ALT-D to get to address bar and select URL
Press ALT
Send>d
Release ALT
Wait>0.2

//Copy URL to clipboard
Press CTRL
Send>c
Release CTRL

//Now you can focus the other application and do CTRL-V to paste:
SetFocus>other_app_title
Press CTRL
Send>v
Release CTRL

//Or get the clipboard value into a variable and display it:
GetClipBoard>sURL
MessageModal>sURL
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

jkukuda
Newbie
Posts: 6
Joined: Mon Nov 24, 2008 2:45 am

Internet URL

Post by jkukuda » Tue Nov 25, 2008 2:15 am

The following script works when run from the macro scheduler.
However when compiled the CNTRL g does not get executed.

//Focus IE
SetFocus>HCSO Arrests - Windows Internet Explorer
//Press ALT-D to get to address bar and select URL
Press ALT
Send>d
Release ALT
Wait>0.2

//Copy URL to clipboard
Press CTRL
Send>c
Wait>0.2
Release CTRL

//Now you can focus the other application and do CTRL-V to paste:
SetFocus>Alpha Five - [SearchEngine]
//Press CTL-D to get to address bar and select URL
Press CTRL
Send>d
Release CTRL
Wait>0.2
Press CTRL
Send>v
Release CTRL
Wait>0.2
Press CTRL
Send>g
Release CTRL

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

Post by Marcus Tettmar » Tue Nov 25, 2008 9:23 am

What does CTRL-g do? You might just need a longer delay between the ctrl-v and ctrl-g. The compiled version may be running a bit quicker. Make sure the correct window is focused and be sure to allow enough time for events to complete.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Nov 25, 2008 2:41 pm

In addition to the Set Focus on the window, be sure to set the cursor to the correct field/coordinate where you want CTL-g to work.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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