AHK:阅读形式*的.ini
问题描述:
从这里这段代码:https://stackoverflow.com/questions/1687 ... AutoHotkey的AHK:阅读形式*的.ini
我的问题是: 是否有可能将代码分成两个文件?
- 第1部分为 “* .ahk”
- 第2部分为 “*的.ini”
如果有人能告诉我如何做到这一点,我将不胜感激!
; --------------------------------------------------------------part 1
#SingleInstance Force
Flag:=0
Return
^+!F7::
Flag:=0
TrayTip, AutoHotKey, Keyboard setting Default, 1
Return
^+!F4::
Flag:=1
TrayTip, AutoHotKey, Keyboard setting A, 1
Return
^+!F8::
Flag:=2
TrayTip, AutoHotKey, Keyboard setting B, 1
Return
; ----------------------------------------------------------part 2
#If (Flag=1)
x::SoundBeep, 500, 100
k::l
#If
#If (Flag=2)
x::SoundBeep, 2000, 100
l::Numpad5
#If
答
确定这是可能的,但我真的没有在.ini文件中存储autohotkey代码的重点。
使用#Include。
part1.ahk
;--------------------------------------------------------------part 1
#SingleInstance Force
Flag:=0
Return
^+!F7::
Flag:=0
TrayTip, AutoHotKey, Keyboard setting Default, 1
Return
^+!F4::
Flag:=1
TrayTip, AutoHotKey, Keyboard setting A, 1
Return
^+!F8::
Flag:=2
TrayTip, AutoHotKey, Keyboard setting B, 1
Return
#Include part2.ini
part2.ini
; ----------------------------------------------------------part 2
#If (Flag=1)
x::SoundBeep, 500, 100
k::l
#If
#If (Flag=2)
x::SoundBeep, 2000, 100
l::Numpad5
#If
https://autohotkey.com/docs/commands/IniRead.htm – wOxxOm
任何帮助的请求。 – asad41163