I know this isn’t strictly AppleScript, but I’m at a loss and hoping the folks here who use ExifTools regularly could help. I’ve sent a variation of this to Phil (creator of ExifTools) as well:
I’m having a wierd problem with Adobe metadata I hoped you could enlighten me on…
I have an AppleScript I’m writing that, among other things, uses ExifTools (nice tool!) to append some information to the metadata in an image file. The basic goings-ons are:
–Script edits metadata (some already exists from a stock photo house)
–Script restores resource fork info (did you know ExifTools eradicates the File Type and File Creator in the Mac Resource Fork?), metadata edits still okay
–Script opens file in Photoshop, performs some operations.
–Script saves image out of Photoshop…metadata edits disappear (but original metadata before the edits is fine)
So the gist is that while the metadata added by ExifTools survives, is visible in Adobe Bridge, etc., the minute the file is resaved out of Photoshop to a new file, the edits are removed and the state previous to the edits is restored.
It is almost like Adobe has some invisible “pointer” or “flag” set that recognizes edits it’s software didn’t make and simply ignores everything after the pointer. Best way I have to describe it.
The line in my script used to write the metadata is:
do shell script ((quoted form of g_command_path) & " -SpecialInstructions=" & quoted form of write_instructions & " " & quoted form of (POSIX path of item_alias))
If that looks bizarre, the actual code ExifTools sees is:
So right after the edit is made, the [Clorox Creatve Contract ID: ] is there in the metadata, very happy, right after any copy that was already there (RF Image, Not Model Released, Not Property Released). But when the script opens the file and then resaves it, the “[Clorox” info is missing from the new file, but the previously existing “RF Image” stuff is still there. Very odd.
Wierder is that the way I have it set-up above, it erases Special Instructions and re-writes it with a a variable that has manually recombined the existing data with my new data (i.e. not using ExifTool’s appending features, since I couldn’t figure out how to make that work):
if exif_instructions is "" then
set write_instructions to ""
else
set write_instructions to paragraph 1 of exif_instructions & " "
end if
set write_instructions to write_instructions & " [Clorox Creative Contract ID: " & add_contract_ID & "]"
I can get around it by doing the metadata edits last after the Photoshop work, but it concerns me that the data may simply vanish the next time the user opens and resaves the file…unbeknownst to me.
Any ideas?