ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: pedroparamo on September 07, 2010, 04:11:09 PM

Title: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: pedroparamo on September 07, 2010, 04:11:09 PM
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
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: Phil Harvey on September 07, 2010, 06:50:55 PM
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
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: pedroparamo on September 08, 2010, 09:26:43 AM
I think you are right but how do I find the backtick and replace it with an apostrophe?

Pedro
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: Phil Harvey on September 08, 2010, 07:27:17 PM
If you cut and paste your examples from the forum into the Script Editor, they should work.  They did for me.

- Phil
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: Phil Harvey on September 09, 2010, 09:59:22 AM
Ah.  I see it isn't as simple as all that:

Apple support discussions thread (http://discussions.info.apple.com/thread.jspa?threadID=2573115&tstart=0&messageID=12235406)

- Phil
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: pedroparamo on September 09, 2010, 01:02:54 PM
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
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: pedroparamo on September 13, 2010, 09:57:17 AM
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
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: pedroparamo on September 21, 2010, 10:45:52 AM
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
Title: Re: "sh: -c: line 0: unexpected EOF while looking for matching `''
Post by: Phil Harvey on September 21, 2010, 11:03:53 AM
I would think you should start from the Adobe Photoshop SDK (http://www.adobe.com/devnet/photoshop.html).  If it is a reasonable SDK, it should contain samples that you can build from.

- Phil