• 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
Dumb Finder scripting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dumb Finder scripting question


  • Subject: Dumb Finder scripting question
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 13 Dec 2007 22:04:33 -0500

OK, I have a list of files, all named *.avi.  I want to go through and find out which ones don't already have a corresponding .mov file.  In the shell, I could do this:

for f in $files; do
   if [ ! -f "${f%.avi}.mov" ]; then ...
   ...
   fi
done

I'm not sure what I'm trying to do is directly supported.  If I have to fall back on using TID to split and rejoin the name, OK, but I was thinking there might be a way to take an alias, modify its target  ( e.g. by changing the "name extension"), and then seeing if the result is still a valid file (probably via a try block that catches the exception thrown if it doesn't).

--
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: Dumb Finder scripting question
      • From: Laine Lee <email@hidden>
  • Prev by Date: Re: Getting the time zone
  • Next by Date: Re: Getting the time zone
  • Previous by thread: Re: Getting the time zone
  • Next by thread: Re: Dumb Finder scripting question
  • Index(es):
    • Date
    • Thread