AutoHotkey Community

It is currently May 27th, 2012, 6:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: August 5th, 2011, 12:45 am 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
Hello,

Just as WinGetTitle shows you the title to use for commands directed towards that window, is there a way to determine what name must be used to Run a particular application?

For example, suppose you want to launch a new instance of Google Chrome. Is there a command which, after opening Google Chrome manually, will display the correct term or wording to use so that it can be opened with an AHK script?

I tried the following:

Run, Google Chrome
Run, GoogleChrome
Run, Google Chrome.exe
Run, GoogleChrome.exe

but each time only got an error message:

Quote:
Error: Failed attempt to launch program or document

Specifically: The system cannot find the file specified


Finally, I discovered the correct one:

Run, Chrome.exe

but it would be helpful if there was a better method than trial and error. I still haven't figured out how to run Internet Explorer.

By the way, now that I have got the Chrome app figured out, is there an AHK command that will launch a new tab rather than an entirely new instance?

Thanks

_________________
"A person who has never made a mistake is a person who has never tried anything new." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2011, 12:48 am 
Offline

Joined: July 16th, 2011, 6:45 am
Posts: 209
Open it up and look at the processes in the task manager, should give you the path needed. To your other question, I don't know. I think there would be, and I think something was made for it. Find the shortcut for a new tab in chrome is the only thing I can think of.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2011, 2:17 am 
Offline

Joined: February 6th, 2010, 5:17 pm
Posts: 57
Code:
Run, chrome.exe "http://www.google.com" ;pass a url as a parameter to launch it in an existing window
Run, chrome.exe "http://www.autohotkey.com"
WinWait, ahk_class Chrome_WidgetWin_0

WinGet, name, ProcessName, ahk_class Chrome_WidgetWin_0
WinGet, path, ProcessPath, ahk_class Chrome_WidgetWin_0 ;requires AHK 1.1.01+
MsgBox, %name%`n%path%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2011, 9:04 pm 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
JakeW wrote:
...look at the processes in the task manager, should give you the path needed...

Thanks Jake! That's simple & accurate.

_________________
"A person who has never made a mistake is a person who has never tried anything new." ~Albert Einstein
"Any fool can make things larger and more complex. It takes a touch of genius...to move in the opposite direction." ~Albert Einstein


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, Bing [Bot], JSLover, sjc1000 and 62 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