"sh: -c: line 0: unexpected EOF while looking for matching `''

Started by pedroparamo, September 07, 2010, 04:11:09 PM

Previous topic - Next topic

pedroparamo

Why does this work

do shell script "exiftool -CopyrightNotice='© Pedro Paramo, 2010' '/Users/Peter/Desktop/22222/62480-03.jpg'"

but this

do shell script "exiftool -MWG:Creator='Pedro Paramo' '/Users/Peter/Desktop/22222/62480-03.jpg'"

give me the error

"sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file" number 2


They look the same to me??

Thanks.

Pedro

Phil Harvey

I cut and pasted these commands into the Script Editor and they both work fine (after changing the path to a file that exists).

I suggest that you have a backtick (`) instead of an apostrophe (') in your version.  This could cause the problem.

- 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

I think you are right but how do I find the backtick and replace it with an apostrophe?

Pedro

Phil Harvey

If you cut and paste your examples from the forum into the Script Editor, they should work.  They did for me.

- 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

...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

You are right about the backtick--it is in my variable which is created in applescript before it is passed to Exiftool.  It's cause by a space in my variable which needs to be escaped before it is passed to Exiftool.

Thanks.

Pedro

pedroparamo

Actually this backtick seems to be related to Photoshop.  I was experiencing a similar problem before (see previous post https://exiftool.org/forum/index.php/topic,2776.0.html).  If I open and save the files in Photoshop and then run my script everything works fine.  Perhaps I can try to find out how to write a plugin for Photoshop that you mentioned.

Thanks.

Pedro

pedroparamo

Anyone know where I might find information on how I would go about writing a plugin for Photoshop as a solution to this?

Thanks.

Pedro

Phil Harvey

I would think you should start from the Adobe Photoshop SDK.  If it is a reasonable SDK, it should contain samples that you can build from.

- 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 ($).