文件:SubmitParams.ahk
#Persistent
#SingleInstance force
GoSub, getParams
; construct tray menu -- DEBUG: optional
Return
/*
********** Subroutines **********
*/
; process command line parameters -- DEBUG: optional (see above)
getParams:
If 0 > 0
{
Loop, %0% ; for each parameter
{
param := %A_Index%
; check for switches
MsgBox %param%
StringLeft, paramType, param, 1
If paramType = - ; switch indicator
{
; determine type of switch
StringMid, switch, param, 2, 1
; switch
If switch = x ; DEBUG: template (replace "x")
{
; access value (= next parameter)
param = % A_Index + 1
var_x := %param% ; DEBUG: template (replace "var_x")
}
}
}
}
Return
文件:testSubmitParams.ahk (可以编译以后用命令行来处理)
run SubmitParams.ahk /in -help
>>https://autohotkey.com/board/topic/6953-processing-command-line-parameters/