How to make a script applet
Making a script applet is not much harder than actually making a script – from the outside the extension changes to .app, and the app when clicked will “run” rather than open in script editor. Mostly useful.
I use Script Debugger for all my AppleScript work. It’s a billion times better than Script Editor. Specifically for applet design, it makes life simpler for adding and removing resources, and you can also add your icons and developer ID easily. You can do this in Apples’ Script Editor but for the uninitiated, it is a journey of questions, throwing things and swearing.
Start a new script from File > New Script and choose Application> Applet in the Script Template tab:
Once open you will see the following:
You can add script resources (files, icons, libraries and other scaffolding) using the “+” icon within the bundle tab (suitcase icon in the toolbar). Make sure to save your applet before you add, as it can get squirrely adding resources when its still in memory.
In the example here I’ve made an .icns file (a new icon for the applet) and added a folder containing a text file, and a snippet of code for demo.
Once added you can choose the .icns file as an alternative to “applet”. This gives the script a nice custom look so it looks nice and shiny on the mac.
The code in my applet is very simple – this just demonstrates some syntax to get the path of x resource, then show it on screen for the user. The standard additions command “path to resource” is important, as we will want to use the paths in the final project for copying the resource from the bundle, to the destination Mac.
For the final project in Capture One shortcuts for the terminally curious I want to build an applet that will install the scripts for my guy, plus add shortcuts to them. An applet is perfect for this as I can bundle all the resources I need in the applet (making it super easy to distribute). Another goal was to have the project reusable for other clients/projects so I don’t have to spend hours changing key value pairs in xml or escaping super long shell scripts because the clients use spaces in all their naming.