unexpected EOF error

Started by pedroparamo, June 09, 2010, 05:23:22 PM

Previous topic - Next topic

pedroparamo

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

pedroparamo

Thanks!  I would have never figured this out...

Pedro

Phil Harvey

On a different note, it may be useful for you to read FAQ number 17 to see how to write list-type tags properly. :)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Ah.  From your thread in the Apple discussion list I see this is done in a Mac script with:

set keywordStr to quoted form of keywordStr

Neat.  I should have known this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).