For the last few days I have been trying to build my first bona fide Aperture plugin. The effort began pretty simply, I ran into a few hiccups along the way, but now I have actually created a plugin that works, and well, it does a very nice job of… you guessed it, exporting images from within Aperture.
I know what you’re thinking. So, what? Right? Well, I am pretty green when it comes to developing anything for OS X. In fact all of my previous coding experiences took place on either Windows or UNIX and was mostly done in C++, VB, or some unusual digital image processing language. And, regardless of my previous coding experiences, they are all just that, previous. So, all of this is a refresher for me.
I became inspired to write a plugin shortly after I began this site and also, after reading one of my favorite blogs, Bagelturf. Bagelturf talks about a number of topics, but he has a good section of his site dedicated to Aperture, and recently he began blogging about writing an Aperture plugin. Maybe it’s serendipity, but he put out his first plugin related article around the same time that I decided to put up this site. Anyway, I have been following along, emailing him, and doing my best to catch up, ever since he wrote the words, “I am going to write an Aperture plugin.”
Bagelturf describers his series of posts as “…showing what the landscape is like for anyone contemplating writing a plugin for Aperture.” If you are interested, I highly recommended checking out his Aperture plugin odyssey.
As for my own plugin efforts, I have gotten to the point where my project a) compiles, b) shows up in Aperture, and c) exports an image. I know, its not exciting, but it is a start.
Here is what I had to do to get to this point.
First of all, I needed to make sure I had a number of things set up and installed on my machine. I downloaded the Aperture SDK (check the resources page for links to the SDK) and installed it on my machine. Installation required a few steps, but they are all laid out in the readme file that comes with the download.
I also made sure to upgrade to the most recent version of XCode. Once I had these two pieces set up and ready to go, I opened XCode and created a new project using the Aperture Plugin template.
The template, as you can read about on Bagelturf, includes the two .h files that are needed for the Aperture functions. It also includes a main .m file, which is where most of your code will go. In the .m file (named after whatever you titled your project) you will find a number of placeholders. These placeholders need to be filled in before the code will compile.
To get things going quickly, I went through and filled in the placeholders with the best answers I could think of. In future posts I will go into detail about the code. My main goal this time was to get something compiled and working in Aperture. Once I had all the placeholders filled in, I compiled the code. This built me a plugin, which I could then copy over to my plugins folder in ~/Library/Application Support/Aperture/Plug-Ins/Export. Afterwards I realized that I could set XCode to build the project directly into this same location. This would keep me from having to continually copy the file over while I am testing things out.
Once the files were built and in the right spots, I opened Aperture and found my Export Plug-In sitting there with all the rest of the plugins. I actually didn’t need to do anything to the interface, as the template already has features built in for things like selecting Versions or Masters, or picking an Export Preset. Anything that I do with the interface will sit on top of these built in features.
Well, so far the plugin exports an image. Yay! In my next post I will go into more detail about how to get to this point. Bagelturf is way ahead of me, so make sure to read his articles, but check back here too and see how things are going.
As I progress I will keep the updated project online so you can download it and try things out for yourselves. Check for it in the next post. And again, if there is anyone out there who wants to join in the fun, we can surely collaborate. Just let me know.
This entry was posted on Tuesday, February 6th, 2007 at 1:21 pm and is filed under Projects. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

