AutoHotkey Community

It is currently May 26th, 2012, 5:18 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: March 2nd, 2009, 8:10 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Hi,

I'm using AutoHotkey to start Locate (http://www.locate32.net/) with the Win+f key combination, and (annonyingly) often Locate wouldn't start another instance but only bring an instance that's already running to the foreground. And when that happens I can try as often as I want, Locate would NOT start another instance. I'm using this code:

Code:
#Persistent
#f::
IfExist,C:\Program Files\Locate
  run, C:\Program Files\Locate\Locate32.exe -i
return


The Locate author suggested that AutoHotkey is the problem since he can't reproduce this behavior without AutoHotkey - and this seems to be correct, when I just hit Win+r (to open Windows' execute box) and type
Code:
C:\Program Files\Locate\locate32.exe -i

there, it works just fine!

So... do I have to change the AHK code to make this work correctly?

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2009, 8:39 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
use fullpath
Code:
#Persistent
#f::
IfExist,%A_programfiles%\Locate\Locate32.exe
  run, %A_programfiles%\Locate\Locate32.exe -i
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2009, 10:55 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
garry wrote:
use fullpath
Code:
#Persistent
#f::
IfExist,%A_programfiles%\Locate\Locate32.exe
  run, %A_programfiles%\Locate\Locate32.exe -i
return

I get an error when I try that:
Quote:
Error: This line does not contain a recognized action.


Edit:
I then tried
Code:
#Persistent
#f::
IfExist,%Programfiles%\Locate
  run, %Programfiles%\Locate\Locate32.exe -i
return

but that isn't solving the problem either.

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2009, 12:58 am 
Offline

Joined: August 2nd, 2008, 12:31 am
Posts: 101
Why not just use:

Code:
#Persistent
#f::
run, C:\Program Files\Locate\Locate32.exe -i
return



if that doesn't work, try putting quotes around it:
"C:\Program Files\Locate\Locate32.exe"
then:
"C:\Program Files\Locate\Locate32.exe -i"

_________________
Woot.

Please read forum etiquette


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2009, 2:06 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Jex wrote:
Why not just use:

Code:
#Persistent
#f::
run, C:\Program Files\Locate\Locate32.exe -i
return



if that doesn't work, try putting quotes around it:
"C:\Program Files\Locate\Locate32.exe"
then:
"C:\Program Files\Locate\Locate32.exe -i"

The extra check is to make sure the hotkey wouldn't work on another system where Locate is not installed.

I changed it to:
Code:
#Persistent
#f::
IfExist,%Programfiles%\Locate
  run, "C:\Program Files\Locate\Locate32.exe" -i
return

and while it *seemed* to work at first, it still isn't *always* causing the expected results (like using Windows' command line). Strange...

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2009, 11:50 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
I tried to make it work with %comspec% but that also failed...

Anyone got more ideas how I could make this work? Or *is* this a bug?

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2009, 3:09 pm 
Offline

Joined: February 7th, 2008, 9:48 pm
Posts: 509
try adding workingdir

Quote:
The working directory for the launched item. Do not enclose the name in double quotes even if it contains spaces. If omitted, the script's own working directory (A_WorkingDir) will be used.





Quote:
Run, Target , WorkingDir



:D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2009, 3:25 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Thanks for the suggestion.

Sadly, that also doesn't work. It still mostly just activates the Locate instance that has been launched most recently.

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2009, 3:46 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Change locate as, tools|options|keyboard shortcuts:
Change or remove the shortcut for Win+f|Global (hook)|Open dialog.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2009, 4:17 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
tonne wrote:
Change locate as, tools|options|keyboard shortcuts:
Change or remove the shortcut for Win+f|Global (hook)|Open dialog.

Aaaaaaaaaaaaaah... who would have thought of THAT... (I obviously didn't) 8)

Thanks a lot!

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, mrhobbeys, Mtes, perlsmith, rbrtryn, stanman, Yahoo [Bot] and 73 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