I am moving this post here from an old blog I started a few years back which has lain dormant for a while. The one post that did garner a bunch of attention was the Adobe Bridge script I cobbled together to automate creation of the XML needed to use the lovely photo gallery presented by the developers of Adobe Spry. I’ve used this script to create photo galleries for many client sites as well as my own.
I do plan on addressing code design here, so this is an appropriate place for the script to live.
Spry is a relatively new and easy-to-use AJAX library. AJAX use is very common on the web today, one of the technologies that powers what is often referred to as “Web 2.0.”
Basically, the technology allows webpages to change and update without requiring the user to “refresh,” “reload,” or navigate to another page. For example: Gmail, which updates every incoming mail every so often without user interaction. And saves drafts every so often in the same fashion.
Find the download link and nuts and bolts of using the script after the jump.
The script is based on one I found at the Adobe User to User Bridge Scripting Forum for exporting a CSV file. It will generate a very useful photos.xml from Adobe Bridge, which makes it very easy to add titles, keywords, ratings — all kinds of metadata that one might use in a photo gallery.
The script generates the required XML nodes for each image, such as “path,” “width,” and “height,” calculates appropriate thumbnail width & height per your chosen pixel size, and uses keywords as categories, titles as captions, and allows sorting by rating (stars in Bridge).
Note: this particular script doesn’t take into account CDATA that might exist in your metadata, like ampersands in your title. Thus far, I’ve just avoided using those, but one could also have the script write out a CDATA node for that info instead. Also, a commenter on my old post noted that the script will break if you have a folder nested inside your source folder of images.
The script goes in the folder “StartupScripts” in Program Files/Common Files/Adobe/ (Windows).
(Update: On a Mac, the script goes in Mac HD/Library/Application Support/Adobe/Bridge CS3 Extensions/Bridge Start Meeting/, at least in CS3.)
Launch Bridge and browse to a folder that contains the files you want in your gallery — the “source” folder.
Choose the menu command “Tools > Export XML for Spry Gallery”.
Type a name for your XML file in the Save dialog box, choose a location, and hit “Save”.
In the dialog box that pops up, enter a max length/width for your thumbnails, in pixels. Some common sizes are “75″ , “100″ or “125″.
Hit “OK”. You should see an alert pop up telling you “XML file successfully created!”