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 

Doesn't work: #run xyz.ahk "parameter"

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



Joined: 12 May 2009
Posts: 27

PostPosted: Fri Jan 08, 2010 3:43 pm    Post subject: Doesn't work: #run xyz.ahk "parameter" Reply with quote

Hello,
I have a script which can be opened directly or within another ahk file by using "run":

Run, xyz.ahk


By calling this file from another ahk file I want to run it with a parameter like

Run, xyz.ahk "parameter 1"

Error message:



So, how it is possible to "Run" / open a ahk file within another ahk file with parameters?

carlos
Back to top
View user's profile Send private message
aguy
Guest





PostPosted: Fri Jan 08, 2010 3:46 pm    Post subject: Reply with quote

remove the quotes i believe
Back to top
mtemp



Joined: 12 May 2009
Posts: 27

PostPosted: Fri Jan 08, 2010 4:56 pm    Post subject: Reply with quote

aguy wrote:
remove the quotes i believe


No, the same error message appears.

Online help for "Run":
To pass parameters, add them immediately after the program or document name. If a parameter contains spaces, it is safest to enclose it in double quotes (even though it may work without them in some cases).
And interpreting "immediately" as "without blank" results in an error message, too...


carlos
Back to top
View user's profile Send private message
svi



Joined: 09 Oct 2006
Posts: 236
Location: Finland

PostPosted: Fri Jan 08, 2010 5:05 pm    Post subject: Reply with quote

I quess you'll have to specify the executable:
Code:
Run AutoHotkey.exe xyz.ahk params

_________________
Pekka Vartto
Back to top
View user's profile Send private message
mtemp



Joined: 12 May 2009
Posts: 27

PostPosted: Fri Jan 08, 2010 5:14 pm    Post subject: Reply with quote

svi wrote:
I quess you'll have to specify the executable:...

Hmm, without parameters and without authotkey.exe the ahk script will be processed.

But let's have a try...

Wow! That's the solution!

e.g.
Code:
Run, autohotkey.exe target.ahk "parameter 1" "para2" "\"with quotation mark"

target.ahk:
Code:
msgbox, %1%`n%2%`n%3%


Many thanks for your help!!
Back to top
View user's profile Send private message
Display posts from previous:   
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