Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [AutoHotkey.ahk]
- ; Includeするファイルリスト
- #Include %A_ScriptDir%
- includeFiles := "InputA,InputB" ;この部分だけ書き換えたらInitもIncludeも自動的にされるようにしたい
- ; 各ファイルのInitセクションへGoSub
- Loop, PARSE, includeFiles, `,
- {
- If (isLabel("initLabel_" . A_LoopField))
- GoSub, initLabel_%A_LoopField%
- }
- ; Autoexecuteここまで
- Return
- ; LoopでIncludeしたい(#Includeは変数で指定できない 困った)
- ;Loop, PARSE, includeFiles, `,
- ; #Include %A_LoopField%.ahk
- ; (これなら正常動作するけど、結局全部手打ちだから避けたい)
- #Include InputA.ahk
- #Include InputB.ahk
- ;============================================================
- [InputA.ahk]
- initLabel_InputA:
- textA := "A"
- Return
- a::MsgBox, % textA
- d::MsgBox, % (textA . "D")
- ;============================================================
- [InputB.ahk]
- initLabel_InputB:
- textB := "B"
- Return
- b::MsgBox, % textB
- c::MsgBox, % (textB . "C")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement