AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using #g to search Google but met a stumbling block :-(

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
tazmanian



Joined: 17 Nov 2007
Posts: 16

PostPosted: Sat Dec 29, 2007 7:53 pm    Post subject: Using #g to search Google but met a stumbling block :-( Reply with quote

I am trying to use the combination #g for searching Google for something. For example, you would highlight text and then press #g.

Code:

#g::
   Send, ^c
   IfWinExist Firefox
      Run, Firefox http://www.google.com/search?q=%Clipboard%
   else
      Run, http://www.google.com/search?q=%Clipboard%
Return

If firefox is open then it will use that otherwise it will use Internet Explorer (which loads faster). It does not work if Firefox is open because I am using the RUN command wrongly. Is there anyway to use the RUN command or any similar one where you can pass in an argument which it uses?

P.S I got this brilliant idea of life hacker:
http://www.lifehack.org/articles/technology/10-ways-to-use-autohotkey-to-rock-your-keyboard.html
Back to top
View user's profile Send private message
ManaUser



Joined: 24 May 2007
Posts: 906

PostPosted: Sat Dec 29, 2007 8:29 pm    Post subject: Reply with quote

It looks like maybe all you need to do is use the full path to Firefox. That is:
Code:
Run, C:\Program Files\Mozilla Firefox\Firefox.exe http://www.google.com/search?q=%Clipboard%

(Adjust if yours is in a different directory, of course.)
Back to top
View user's profile Send private message
tazmanian



Joined: 17 Nov 2007
Posts: 16

PostPosted: Sat Dec 29, 2007 8:39 pm    Post subject: Reply with quote

Thanks Mana!

It now works perfectly. Before it was searching the registry for firefox ...google... whereas now it is using the actual exe.

Code:

#g::
   Send, ^c
   IfWinExist Firefox
      Run, C:\Program Files\Mozilla Firefox\Firefox.exe "www.google.com/search?q=%Clipboard%"
   else
      Run, www.google.com/search?q=%Clipboard%
Return
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group