Capture Web URL

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ghost24
Newbie
Posts: 9
Joined: Mon Oct 22, 2012 11:51 pm

Capture Web URL

Post by ghost24 » Fri Jun 14, 2013 10:04 am

Hi,

Following problem. I think a small problem for a professional, but for me a big one!
:-(

I open a web-Browser (IE, Firefox ore Chrome) and oben a web-url.

now i need a macro witch do the following:

Step 1
i click on the URL line (left click) the Macro must now catch this url (the url from the page how ii is just at the moment open) and write it to a file (example to a .txt File)
Step 2
then it must print this URL to a message Box and must ask if the url is correct. there i need 3 Buttons OK and Cancel and Retry

All the things are ok and no problem for me like the message Box and the question and so on, but i dont find any command to capture the url from a browser?

Any one there with a idea ore with help for me?

thanks a lot and sorry about the bad english!
;-)

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

Post by Marcus Tettmar » Fri Jun 14, 2013 1:21 pm

CTRL-L puts the cursor in the address bar in all three browsers. You can then copy the address to the clipboard. So something like:

//select address
Press CTRL
Send>l
Release CTRL
Wait>0.5

//capture to clipboard
Press CTRL
Send>c
Release CTRL

//Get from clipboard
Wait>0.2
GetClipBoard>URL

You now have the URL in a variable.

The above assumes the browser already has the focus.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Re: Capture Web URL

Post by armsys » Fri Jun 14, 2013 1:21 pm

ghost24 wrote: Step 1
i click on the URL line (left click) the Macro must now catch this url (the url from the page how ii is just at the moment open) and write it to a file (example to a .txt File)
Step 2
then it must print this URL to a message Box and must ask if the url is correct. there i need 3 Buttons OK and Cancel and Retry;-)
Try:

Code: Select all

Let>SK_Delay=1
Press CTRL
send>l
Release CTRL
Press CTRL
send>c
Release CTRL
GetClipboard>Text
MDL>Text
Hope it helps.

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