AutoHotkey Community

It is currently May 27th, 2012, 3:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: March 20th, 2010, 7:12 am 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
All, I have a doubt and I hope it can be answer here.

I would like to write a script that allows me to launch a browser when I clicked on a URL that is on my email. I would like to Automate this, such as when i clicked on the URL :

1. It will launch my default browser
2. It will automatic enter URL into the address field in the browser
3. It will load to the URL page that i have selected.
4. Lastly i am trying to do this on a remote desktop.


Anyone think is this feasible to do so?

Thank You All.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 8:50 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
Which email? Which browser?

#1,2,3 are standard/commonplace for most email programs.
Check the configuration settings.

Not sure about #4.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 9:17 am 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
Hi Leef_me,

Email is just a example. Because i would like to select on a URL on my current system that isn't connect to the internet. The URL can be in a doc/textfile/application/email. And this will help me to launch IE/Firefox on my remote system is connected to the internet.

so is it possible to insert the URL using AutoHotKey into the browser field? and to launch to the URL page?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 10:19 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
My suggestion:
- setup a hotkey that selects a line of text and copy to clipboard either via send {home}{shift down}{end}{shift up}^c or perhaps mouse double/tripple click
- extract the URL from the copied line (search forum for regexmatch urls, links)
- run url

Try somethings, post code if you get stuck.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 7:40 pm 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
Ok, Thanks you hugov. I will try some code as i am new to AutoHotKey. ((:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 8:43 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
Esther 21 wrote:
so is it possible to insert the URL using AutoHotKey into the browser field? and to launch to the URL page?
Yep.
Depending on the browser, there is likely a hotkey to select the _address field_ and the usual result is that the whole contents is selected.
In I.E. both the hotkeys F6 and Alt-d both seem to do the job.

I can't speak to the "remote desktop" aspect of the question because I have never had the need or setup.

The simple methods to use are the same as what you would do manually.
1 find the address someplace
2 select the text of the address
3 copy the address with alt-edit-copy (control-C) ^c in Ahk
4 switch to the browser, or open it if not already open
5. select the _address field_ (click, or F6 or alt-d; your choice)
6 paste the prior copied address and hit enter to >go<

In the code below, F2 performs steps 3...6

F1 is just a hodgepodge collection of thought on how to get the address besides control-c

Code:
settitlematchmode 2 ; <----- easier to match a title, still must spell and CaPiTaLiZe correctly
return

f1::         ; you can use several methods to open a webpage

web=http://autohotkey.com   ; a variable
;run %web%

;run http://www.autohotkey.com/forum/   ; hard-coded


send {f6}   ; this is assuming that I.E.is alreaad open and you wish the
      ;      new address to replace the current contents
sleep ,100
send %web%

sleep ,100
send {enter}
return


f2::   ; pre-select the webaddress and then hit F2

send ^c   ; the copy shortcut that works in most windows-based programs

address=%clipboard%   ; read the address from the clipboard
         ;   for more information, search for 'clipboard' in the help file

IfWinNotExist, Windows Internet Explorer ;
{
  run   %addess%
}
else
{
  winactivate, Windows Internet Explorer

  send {f6}   ; <----- hotkey causes I.E. to select address bar
  sleep ,100
  send %web%   ; paste the address
  sleep ,100
  send {enter}   ; enter to 'go there'
  return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 4:41 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
on every system i have ever seen clicking any link opens the link in the default browser what happenes on yours?

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 2:00 am 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
Hello Leef_me

Thank you so much for the codes. I have learned some functions of the codes out of it. Thank You! ((:


Hi Tank,

Oh, i understand on every system we are able to click and select on the url that launches the browser. Because i am trying to launch the url on etc notepad/application/ or just having the link.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 6:42 am 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
Hi Leef_me,

I am trying to perform the code here by tripple click on the left mouse button, after selecting on the text of the address. Can you tell me how?

Because i tried the code:

Keywait, Lbutton,
Keywait, Lbutton, D


following by the codes...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 6:26 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
Esther 21 wrote:
Hi Leef_me,

I am trying to perform the code here by tripple click on the left mouse button, after selecting on the text of the address. Can you tell me how?


I can point you to how to detect multiple of a key/mouse button, look at Example #3
http://www.autohotkey.com/docs/commands/SetTimer.htm


As far as 3 x Lbutton after selecting text, I believe a script will interfere with the normal operation of Lbutton.
And the normal operation of Lbutton is to help mark a section of text to copy.
My tests revealed that if I click other than in the selected block of text, that selected block is deselected.

I suggest using the 3 x click with Rbutton

Alternate questions:
must this be done with a single hand? on the mouse?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2010, 2:38 am 
Offline

Joined: March 20th, 2010, 7:01 am
Posts: 30
Hi Leef_me

Thanks for the reply (:
Yah i did some test as well. The x3 single click will interfere with normal operation of Lbutton.

I am looking for various ideas to implement this, so i am looking at the mouse as well. Hmm..i tired including the following codes that help me to auto highlight and copy when the middle button is clicked.

Mbutton::
click 2
send ^c
address =%clipboard%

Thanks for the link (: i will read it up and see if i could implement it using the x3 Rubutton

Thank you so much


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn, Yahoo [Bot] and 29 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group