• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Do shell script vs terminal discrepancy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shell script vs terminal discrepancy


  • Subject: Re: Do shell script vs terminal discrepancy
  • From: Paul Skinner <email@hidden>
  • Date: Sat, 05 Dec 2009 09:01:00 -0500

Simon,

	Thank you for curing my ignorance!

	So, with my full path, this works for jpg files now.

set thumbPath to "Mac HD:Users:paul:Desktop:smile.jpg"
set pp to quoted form of POSIX path of thumbPath
set r to do shell script "export PATH=\"/opt/local/bin:/opt/local/ sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/ paul/bin/:/Users/paul/.gem/ruby/1.8/bin\" ; convert " & pp & " -scale '3x3!' -compress none -depth 8 ppm:- | tail -n +4"


-->"194 194 132 184 182 36 194 194 135 183 182 39 233 234 17 183 183 29 194 194 135
154 153 38 194 193 140 "


With the path you provided it works for formats that were initially installed with imagemajik, but not those I added later. I suspect a faulty imagemajik instal to be to blame for that.

Now I just have to figure out how to uninstall Imagemajik and do a static install of just 'convert' and then determine how to bundle that into an xCode applescript application. </sarcasm> I'm practically done!

For the curious, this is a component that compares down-sampled versions of iPhoto thumbnails for matching duplicate images with differing file MD5 values. I'm also looking for a method to refer just to the jpg image data in jpg files so that I can directly MD5 that rather than the file as a whole. Any tips would be greatly appreciated!

Thanks so much for the help everyone,
Paul



On Dec 5, 2009, at 5:40 AM, Simon Topliss wrote:

Hi Paul,

You just need to 'export' the PATH before using convert in the same shell session.

do shell script "export PATH=\"/bin:/sbin:/usr/bin:/usr/sbin:/usr/ local/bin/\" ; convert etc…

Simon

On 5 Dec 2009, at 02:43, Paul Skinner wrote:

I'm running 10.5.8

The error was just copied from the dialog that popped. Log stopped after the Do Shell Script line.

Terminal here:
-bash-3.2$ osascript -e 'do shell script "which convert" '
/opt/local/bin/convert

Paul

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • do shell script flaw
      • From: Emmanuel LEVY <email@hidden>
References: 
 >Re: Do shell script vs terminal discrepancy (From: airdrummer <email@hidden>)
 >Re: Do shell script vs terminal discrepancy (From: Paul Skinner <email@hidden>)
 >Re: Do shell script vs terminal discrepancy (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: Do shell script vs terminal discrepancy
  • Next by Date: do shell script flaw
  • Previous by thread: Re: Do shell script vs terminal discrepancy
  • Next by thread: do shell script flaw
  • Index(es):
    • Date
    • Thread