Extending workflows with AppleScript

Update: documentation and examples can be found on GitHub — https://github.com/HedgeForMac/hedge-scripts

Extending workflows with AppleScript
Update: documentation and examples can be found on GitHub — https://github.com/HedgeForMac/hedge-scripts

Software that imposes a workflow on you is annoying. That’s why we’ve built Hedge to be extendible: launch your custom AppleScripts from within Hedge, and the sky is the limit 🚀

Because every workflow is different, AppleScripts are a perfect lightweight way to process your footage after importing it. You are now completely free to build on top of Hedge’s sturdy data handling engine. Enjoy both the security of Hedge, and the flexibility of scripting.

AppleScript

AppleScript is a simple, easy to understand scripting language. It’s built right into the core of OS X and looks very much like regular English. Very powerful but without the regular steeplearning curve. Because it’s so simple, you can easily share and learn from others.

Everything you do in apps like Finder, Quicktime and Preview can be automated with a simple script: sorting, adding tags, renaming, resizing and even displaying notifications.

 display notification with title "Ping" subtitle "Pong"

Try it for yourself: open Script Editor on your Mac, paste this code and hit Run (⌘-R).

With AppleScript you can control other applications too. Automatically opening VLC to preview an imported clip is just one line of code:

tell application “VLC” to open "/Users/Hedge/Desktop/movie.mov"

We once even built a complete DNxHD-transcoder with LTC-support in AppleScript, but that one came out a bit longer than one line 😉

Events

Hedge works with Events. Events occur when a disk is mounted, imported, ejected, and so on. You tell Hedge which script at which event should run, and then Hedge will share data with the script. Every event has its own set of variables, which you can find here, along with example scripts.

Safety First

The big advantage of running your scripts from within Hedge is security.

When you run scripts as standalone apps, they have access to every file on your Mac. This can be dangerous: imagine accidentally running a delete all files and folders except .mov files-script on your Documents folder…

It’s a lot safer with Hedge telling the scripts which folders or files to process. For example, when a disk is done importing Hedge doesn’t provide the location of the copies. Vice versa, when a first copy has been made but the second backup is still busy, Hedge only gives you the destination folder and not the source disk name. That way you can never do something destructive to both sources and destinations, at least not at the same time.

For added security we have given all events unique parameters. Accidentally using a script on the wrong event simply won’t work.

Au-to-mate 🤖

Extending Hedge with scripting is our first step in enabling you to create your own workflow. We hope that this addition gives you a lot more control, instead of having to conform to “the way things work”.

A single app is never going to fulfill your specific needs. There are just too many workflows to build into one app. But when apps can work together it could save you a lot of work. Let’s try to build that, so we can all make better movies.