ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: pedroparamo on June 09, 2010, 05:23:22 PM

Title: unexpected EOF error
Post by: pedroparamo on June 09, 2010, 05:23:22 PM
What does it mean when I get the error

do shell script "exiftool '-keywords=Men's Basketball, YU, Sports, ,' '/Volumes/Photo [Work]/OpenEdit/test/64008C-09.jpg'"
      "Finder got an error: sh: -c: line 0: unexpected EOF while looking for matching `''


I'm using a shell script within applescript that uses exiftool to take the existing  metadata of a file and modify it.  It works on some of my files but with others I get this error message.  I can't seem to figure out why?  Is this a (exiftool) syntax error or what?

Thanks.

Pedro
Title: Re: unexpected EOF error
Post by: Phil Harvey on June 10, 2010, 07:24:27 AM
It's the apostrophe in "Men's" that is causing the problem.  The joys of quoting rules.  The bourne shell does not allow single quotes to be escaped in a single-quoted argument, so you must use double quotes around it.  To do this you will have to figure out a way to escape double quotes in your mac script.

- Phil
Title: Re: unexpected EOF error
Post by: pedroparamo on June 10, 2010, 09:27:04 AM
Thanks!  I would have never figured this out...

Pedro
Title: Re: unexpected EOF error
Post by: Phil Harvey on June 10, 2010, 09:39:52 AM
On a different note, it may be useful for you to read FAQ number 17 (https://exiftool.org/faq.html#Q17) to see how to write list-type tags properly. :)

- Phil
Title: Re: unexpected EOF error
Post by: Phil Harvey on June 11, 2010, 12:12:40 PM
Ah.  From your thread in the Apple discussion list (http://discussions.apple.com/thread.jspa?messageID=11651160) I see this is done in a Mac script with:

set keywordStr to quoted form of keywordStr

Neat.  I should have known this.

- Phil