Contact Us Directly
If you need personal assistance, or you just want to provide feedback, you can reach our support team via email.Contact Us
We're amazingly responsive! We strive to reply in under 24 hours.
Although Audio Hijack's built-in Automations will run your scripts in response to a variety of events, sometimes you need to be able to trigger scripts to run on their own. This article covers the various ways to make that happen.
Out of the box, Audio Hijack does not allow any external script execution. This is a security measure to make it harder for possibly malicious scripts to run. For the individual scripter needing the functionality though, this can be safely bypassed.
Simply open the Preferences window, click on the "Advanced" tab, and then under the Scripting header, turn on the "Allow execution of external scripts" checkbox.
By far the simplest way to have Audio Hijack execute a script, is via a ".ahcommand" file, here after refered to simply as a command file. This is nothing more than a text file (UTF-8 encoded) containing the script, with the file extension set to ".ahcommand".
Simply opening a command file in Audio Hijack, will cause it to immediately execute.
And while we are all familiar with double-clicking on a file to open it, there are many other ways of opening files (and thus executing command files) that are useful to scriptors.
The most useful of these, would be the "open" command-line utility in MacOS. In Terminal, executing a command such as: open -b com.rogueamoeba.audiohijack SomeScript.ahcommand , will cause SomeScript.ahcommand to open in Audio Hijack, and thus execute.
Going further, if one wanted to periodically execute a script, the "open" command above could be used with LaunchServices (or cron).
Finally, both Shortcuts and AppleScript provide a mechanism for opening files, which can also be used to execute command files.
The "Run a Script" action, allows you to select an existing script from Audio Hijack's "Script Library" window, and will execute it when the action executes. If you like to keep all your scripts organized in the Script Library window, this is an easy way to access one.
Whichever method you choose, also be aware that you can also execute your final Shortcut workflows from the command line. See Apple's documentation "Run shortcuts from the command line" for full details.