Loading XMP into Photoshop CS2


I need to batch load XMP metadata into a bunch of Photoshop CS2 files. The dictionary in Photoshop doesn’t let me directly script the Find Info xmp panel so I’m looking for ideas on how to get into it.

I can get to the panel using system events:

tell application "Adobe Photoshop CS2" to activate
tell application "System Events" to keystroke "i" using {option down, shift down, command down}

However, what I need to do next is hit the “Advanced” window on the left and then the “Append” button so I can load in an xmp file that will populate some custom xmp panels I have installed on my Mac.

Using the UI Inspector is giving me muddied results since the XMP panel is tied to the photo that’s opened. I get stuff like:

The word “Advanced” doesn’t show up except in the Attributes section which I’ve never seen scripted.

I’d appreciate any help.


Why not use Bridge to add the metadata from a template. This is very easy and needs no scripting.


Bridge has some real limitations. It won’t let you let you apply metadata templates to a wide range of graphic assets (gifs, pngs, etc. although it does work with jpegs and tiffs). To get to all the graphic assets I’m dealing with I need to open them up in Photoshop and hit them with the metadata and then close the document.


Launching the File Info dialog has been pretty straightforward, but I can’t seem to select the “Advanced” line to get to the dialog with the buttons I need to select my metadata template.

Here’s where I’m at:

tell application "Adobe Photoshop CS2"
	tell application "System Events"
		tell process "Photoshop"
			click menu item "File Info..." of menu 1 of menu bar item "File" of menu bar 1
			delay 0.2
			perform action (row -1 of outline 1 of scroll area 2 of window 1 whose value of static text 1 is "Advanced")
		end tell
	end tell
end tell

I’ve tried “perform action” and “select” and “click” and nothing seems to work. Stepping through the hiearchy, the window level and scroll area return UI elements; when I try a get every UI elements on outline 1 of scroll area 2 of window 1 it errors, yet UI Browser does seem to confirm I’ve got this right.

Any help would be appreciated.