Are you like me having many scripts running but use #NoTrayIcon to hide the system tray icon? It’s a pain to edit scripts as you have to navigate to the folder and edit the file. With AHKScriptHub you have control over all running scripts! Easily pop-open the folder, pause, reload, and more!
Standard library: path-to-the-currently-running-AutoHotkey.exe\Lib\
Order of search
If a function is not found, but has an underscore in the name, it will search for a library with everything up to the underscore. (E.g. If your function is named “IE_Load” it will search for a file named IE.ahk and load it)
Benefitsof using Library: 1) Code maintenance, 2) Fewer files to keep track of, etc. 3) Easier to read code
Negativesof using Library: Sharing code can be a bit more complex
The string(s) you want to pass into the script, with each separated from the next by a space.
Any parameter that contains spaces should be enclosed in quotation marks.
The script sees incoming parameters as the variables %1%, %2%, and so on.
In addition, %0% contains the number of parameters passed (0 if none). However, these variables cannot be referenced directly in an expression because they would be seen as numbers rather than variables.
In the receiver, use Param2 = %2% ;Note NO colon
Pros: Simple, reliable
Cons: Only works when starting up, One-direction, Only passes strings/variables
Registers a unique CLSID (Computer Licence Security ID) in registry (A CLSID is a globally unique identifier that identifies a COM class object. If your server or container allows linking to its embedded objects, you need to register a CLSID for each supported class of objects.)
Pros:Can pass objects, Functions, Variables,Strings, Bi-directional, Super Fast
Cons: Code is more complex, Can’t use FOR loops to iterate over Objects, Can slow some when passing large data
Consolidating Multiple Scripts into One
AutoExec section – (Top of script until first: Return, Exit, hotkey/hotstring label)
Hotkeys – Conflicting Hotkeys prevents script from running (Make them context sensitive?)
Hotstrings – First Hotstring takes presedent
Re-using: Variables , Functions, Labels, Classes cause errors
Duplicate code – Often bring in things multiple times
Reasons why prefer one over the other
Sharing scripts is easier
Troubleshooting can be easier
One file to edit
One script in system tray (Can use #Notrayicon in multiple scritps to help negate this)