The latest build of Download Color Field Images actually includes two Automator actions: The first is the public action that allows you to select a color and download images whose RGB average closely matches that color; The other is a private action that is scheduled to run weekly on my computer. This second action is the one that actually reads the images and tags from Flickr and organizes the color information so that it can be quickly processed. I want these two actions to be part of the same project so I can build them and test them at the same time, and so that any changes to the caching action can be immediately built by the public action that reads the cache.
Apple provides a very simple template for building a single Automator actions with Xcode. Adding a second action to that project, however, isn’t easy because Automator requires each action to have a .nib file with a specific name: main.nib. And therein lies a little problem. If you let Xcode automatically localize your .nib file, it puts an “English.lproj” directory at the top of your project directory. But I couldn’t have two, identically-named “main.nib” files in that same folder.
I initially solved this problem by getting rid of the localizations on both my actions. This allowed me to put each .nib file in it’s own subdirectory of the main project. However, that setup would be a problem if I ever wanted to add localizations.
The solution was to create my own English.lproj directories inside the subdirectories. If you tell Xcode to make a file localizable, it will create the directories at the top level of the project directory, but if you create them yourself anywhere else in the project directory, Xcode is happy to use them. Here’s what my project directory looks like:
It’s an obvious solution, but it was the first time I had run into it, so I thought I’d post.
1 Response to “Multiple Automator Actions, One Xcode Project”