Sadly, the FileInstall command will not allow the use of variables for the source file, so I cannot simply include the script itself ( FileInstall, %A_ScriptFullPath%, %A_Temp%\%A_ScriptName%, 1).Īs a work-around, I ended up extracting all of the desired hotkeys to a second file which I then parse as Elliot suggested, then delete, and #Include at the end of my script (it must be at the end since hotkeys will terminate the autoexecute section). What I did was to use the FileInstall command which tells the compiler to add a file to the executable (and extract it when run). It is not perfect (or ideal), and hopefully a proper, built-in method will become available in the future, but it works well (enough) and for raw and compiled scripts. The ListHotkeys command is not applicable because it only displays the hotkeys as plain text in the control window.ĭoes anyone know how I can display a list of the hotkeys and either their corresponding arguments or comments?Įxample desired “outputs”: C+A+ W+ A a | C+ S+ NumpadMult b.This worked well right up until the last part because the Hotkey command cannot take arbitrary commands as the destination and requires existing labels. I tried assigning the entire hotkey section of the script to a variable as a continuation section and then parsing the variable and creating hotkeys using the Hotkey command.I tried using Elliot’s suggestion of parsing the script itself (replacing the path with %A_ScriptFullPath%, and while it does work for a raw script, it does not when the script is compiled.I checked the docs and there don’t seem to be any A_ variables that can be used for this purpose, nor does the Hotkey command lend itself well (it can be used to test if a hotkey exists, but looping through the innumerable combinations is, at best, tedious). I cannot figure out a way to programmatically access the script’s hotkeys at all. I considered adding a variable to the function so that depending on the value, the function either performs the normal function when triggered by the normal hotkeys, or builds a string or something when triggered from the special display hotkey. The hotkeys all call the same function with different arguments. More problematic is getting the hotkeys and corresponding descriptions. The formatting and display are tenuous since AutoHotkey’s output is limited to message-boxes, but possible. I would like to create another one that when pressed displays a list of all of the hotkeys and their corresponding descriptions that the script contains in a nice, formatted table. I’ve written script that contains numerous hotkeys (general structure is as below).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |