

When Audio Hijack runs that script, it will return a result of true if the session is running, and false if it isn’t. The Run/Stop Session action has no awareness of the current state of the session, so first the shortcut runs a one-line JavaScript: return (app.sessionWithName('Podcast lossless').running) Here’s a simple example: I built a shortcut that toggles a particular Audio Hijack session on or off. You can set the filename and destination of a recording block, for instance, so a shortcut or script can adaptively name and place a file. You can also affect some, but not all, of the variables within a block. That’s because Audio Hijack 4’s initial JavaScript implementation allows you to detect the status of sessions and of individual blocks within sessions, and then turn them on and off. But even if only the Run Javascript in Audio Hijack was available, all things would be possible. (There’s an “allow execution of external scripts” setting in Audio Hijack’s preferences that you’ll need to turn on first.) Run a Script will run a script stored within the Audio Hijack app Run JavaScript will run a script passed to the app from the shortcut, and Run/Stop Session lets you turn a particular session on or off. Right now, the app provides three Shortcuts actions: Run a Script, Run JavaScript, and Run/Stop Session.

It’s a perfect match for the Session Stop event.īut Audio Hijack really unfolds when you integrate it with Shortcuts. One script provided by Rogue Amoeba, Discard Small Files, will delete any recording less than five seconds in length. Individual Sessions can run scripts via the new Scripting tab in each session automations can fire off when a recording, session, or timer stops or starts. ahcommand text files on your Mac, and via scripts sent directly from Shortcuts. While not quite everything in Audio Hijack is controllable (yet), most of it is-and it leads to some really interesting possibilities for users.Īudio Hijack can be controlled by scripts saved within the app itself (the app includes several built-in scripts as samples, and more are available on Rogue Amoeba’s website), via scripts saved as. Rogue Amoeba’s Audio Hijack 4 is here, and while it’s got a bunch of interesting new features, my favorite is its support for automation via JavaScript and Shortcuts. Automating Audio Hijack 4 with Shortcuts and JavaScriptĪn Audio Hijack 4 automation switches blocks on and off and starts a session.
