IPTC Core
I've been able to get a lot of this to work, but I've run into a problem I can't figure out. Here it is...
I have a Microsoft Excel 2008 spreadsheet that includes titles, descriptions, and keywords for my JPEGs.
I have the following Applescript for Adobe Photoshop CS4 to pull that information from Excel to the opened JPEG file...
tell application "Adobe Photoshop CS4"
tell info of the current document
set author to "My Name"
set author position to "Illustrator"
tell application "Microsoft Excel" to copy range (cell 2 of row 53 of worksheet "Keywording 2")
set caption to (the clipboard)
tell application "Microsoft Excel" to copy range (cell 3 of row 53 of worksheet "Keywording 2")
set keywords to (the clipboard)
set copyright notice to "Stephen Hobson"
set copyrighted to copyrighted work
tell application "Microsoft Excel" to copy range (cell 1 of row 53 of worksheet "Keywording 2")
set title to (the clipboard)
end tell
save the current document appending lowercase extension in ("Primary Hard Drive:Microstock:Files | Adobe Illustrator:Automating Now:10 | Series - Shined:6 | JPEG #1:" & (the clipboard) & ".jpg") as JPEG with options {embed color profile:true, class:JPEG save options, quality:12, format options:optimized} with copying
end tell
Everything pulls over and is inserted into the JPEG file with the only "odd" part is that the Keywords field is the only one that copies the information with quotations around it. That shouldn't be a problem though because when I go over to Adobe Bridge CS4 and look at the metadata everything is there and it looks fine.
Here's where the problem is...
When I upload these JPEG files to microstock sites, like Shutterstock for instance, that pull the metadata information and insert it onto the site, only the first 55 to 58 characters of the keywords are inserted then the rest abruptly cuts off? If I copy the keywords from Excel and insert them manually using Bridge and upload the file again, everything is there.
So, the problem must be with Photoshop writing the keywords? I was wondering if it's not getting enough time to save the metadata information before I save and close the file? I thought maybe it was the way I saved things to the clipboard, but every field except Keywords is correct so that probably isn't it. I thought that since the keywords are the only information pulled from a cell with the formula type "=Keywording!F6&Keywording!E6" in Excel that it was giving Photoshop problems? Is there something missing from my script?
I'm just not sure what the trick is so I thought I'd post the problem and see if someone could help? I have an older, more clumsy script that uses the keyboard that works fine, but I'd rather use better scripting to reduce the chance of error. If you need more information please let me know.
Additional Information: When I upload to Graphic Leftovers, I upload one Illustrator EPS file and the one matching JPEG file. However, the site uploads two identical JPEG files with only a few bytes difference. I'm thinking that the larger sized file has all of the metadata and the smaller sized file has the cut-off version. But, why on earth would it upload two JPEG files when I only selected one? Unfortunately, the metadata from the incorrect version is imported, so I think it goes back to the above problem of Photoshop insert and saving all the keywords correctly.
If you have any clues or thoughts please let me know!
Thanks!
