Automator Tools Menu for Xcode
An Xcode plug-in that displays a new menu containing a set of script tools for assisting in the development of Automator Actions.
A script for transferring parameter names from Interface Builder to the active project is also installed.
- Download Installer
- Quit Xcode
- Run Installer
- Open Xcode
Scripts for All Action Projects
Action Setup Assistant This script will guide you through the process of populating the active project's Info.plist file. Run this script first after creating a new Automator Action project.
Add Localization File This script will create a new Localizable.strings file in the Resources group of the active project. Once created, make sure it's Target Membership status is active.
To complete the process of making the file localizable, select the file in the Groups & Files column, and select Get Info from the File menu to summon the information window for the file. Click the General tab in the information window and then the Make File Localizable button.
Blank InfoPlist.strings This script saves a lot of time deleting the instruction strings in the default InfoPlist.strings file. To use, run the script, select the InfoPlist.strings file from the Resources group, select and replace the content of the file with the contents of the clipboard.
Scripts for AppleScript-Action Projects
Derive Filename Sub-Routine This script places a sub-routine, for deriving the filename of a new file, on the clipboard. Very handy when saving copies of files.
Directory Chooser Main Routine When you add an Automator directory chooser control to the action view, and bind it using Cocoa Bindings to a parameter, a relative POSIX path is passed in the action's parameters record to the run handler. This script will place a special routine on the clipboard that you paste into the run handler. The routine will convert the relative POSIX path passed in the parameters record to an AppleScript alias reference to the chosen folder. Additionally, the routine will error if the chosen folder doesn't exist on the user's computer.
Localization Sub-Routine This script places a sub-routine for calling the localization hander on the clipboard. The sub-routine contains the bundle identifier for the active action project. To use, paste at the bottom of your script and pass the key string for a localized string to the routine.
Locate Bundle Resource If your action scripts require accessing resources within the action bundle, this script will place one of two routines on the clipboard for pasting into your code. One routine is for use within the main run handler and the other is for use in scripts that support the action UI (action view).
Run Handler with File Checks If your main run handler processes files passed from the previous action, this script code provides a way to filter the passed files for only those matching specified types, for example, only text files. To use, run the script, then select and replace the contents of the main.applescript file (the one that contains the on run handler) with the contents of the clipboard. Fill-in the information for the file types you want to process.
Run Handler with Image Checks If your main run handler processes files passed from the previous action, this script code provides a way to filter the passed files for only those that are image files, such as TIFF and JPEG files. To use, run the script, then select and replace the contents of the main.applescript file (the one that contains the on run handler) with the contents of the clipboard. The file type information is already filled-in to accept the standard QuickTime image types: JPEG, TIFF, PNGf, 8BPS (Photoshop), BMPf, GIFf, PDF, and PICT
About Automator Tools Menu This script will display a dialog showing the version of the tools menu and a link to this page.
Script for Interface Builder
Parameter Write and Declare Select a parameter name in the NSObjectController Inspector in Interface Builder and copy it to the clipboard. Run this script (from the Script Menu at the top right of the menu bar) and you will be prompted to identify the parameter type (ex.: boolean, string, integer, etc.) and enter a default value. The script will then add the parameter to the AMDefaultParameters property in the Info.plist file of the active Action Project, and will put a parameter declaration statement on the clipboard in Xcode so you can paste it into the run handler of the main.applescript file. Something like:
set this_variable to (|yourParameterName| of parameters) as boolean