ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Help with autohotkey: Command line switches

(1/3) > >>

wreckedcarzz:
I am having trouble figuring out how to add support for command line switches for AHK programs (completed EXEs). I have googled over and over again, searched the AHK forum and documentation, and I can't find anything on it anywhere. I know it can be done due to Skrommel's BatteryRun.

Can anyone help me?

-Brandon

jgpaiva:
Well, that's easy.

--- ---NumberOfArguments = %0%

FirstArgument = %1%
SecondArgument = %2%
ThirdArgument = %3%
I recommend using this method of extracting the arguments to named variables, since '0','1','2' and '3' are pretty crappy names for variables!

wreckedcarzz:
So like


--- ---NumberofArguments = MyArgumentAmount

MyAction1 = /action1
MyAction2 = /action2

correct?

EDIT: Or do I switch those across the equal sign?

wreckedcarzz:
Ah, I figured it out. Thanks a lot for that- it was driving me mad! :)

wreckedcarzz:
Apparently, I didn't quite get it working- it only runs the top item in the list. Can someone take a look at this and explain to me how to get command2 and 3 to show their message boxes? I could only get command to work, but then it would run command2 also. And now nothing works- I am totally lost. :-[

Help, anyone? :tellme:

Navigation

[0] Message Index

[#] Next page

Go to full version