• 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: .chk files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .chk files


  • Subject: Re: .chk files
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 25 Jan 2008 13:58:06 -0500

You've reached the point where there are so many "do shell script"
calls, you're better off (IMO) making the whole thing shell.  Here's a
quick version that I haven't tested...

on Process(fileList)
   set inputList to ""
   repeat with f in fileList
       set inputList to inputList & POSIX path of f & ASCII character 10
    end repeat
    do shell script "
                export MAGICK_HOME=/usr/local
                PATH=\"$PATH:$MAGICK_HOME/bin\"
                while read f; do
                      if ext=\"$(identify -quiet -format %m \"$f\" |
tr A-Z a-z)"; then
                           case "$ext" in
                              jpeg) ext="jpg";;
                              pict) ext="pct";;
                           esac
                           case "$f" in *."$ext") continue;; esac
                           mv -n "$f" "${f%.*}.$ext"
                      fi
               done <<'EOF'" & ASCII character 10 & inputList & "EOF"
end Process

--
Mark J. Reed <email@hidden>
 _______________________________________________
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:
    • Re: .chk files
      • From: Paul Scott <email@hidden>
    • Re: .chk files
      • From: Paul Scott <email@hidden>
References: 
 >Fwd: .chk files (From: "Jordan Hadley" <email@hidden>)
 >Re: .chk files (From: Paul Scott <email@hidden>)

  • Prev by Date: Re: built&released application not functioning on other Macs..
  • Next by Date: Re: .chk files
  • Previous by thread: Re: .chk files
  • Next by thread: Re: .chk files
  • Index(es):
    • Date
    • Thread