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

Re: Dumb Finder scripting question


  • Subject: Re: Dumb Finder scripting question
  • From: Laine Lee <email@hidden>
  • Date: Fri, 14 Dec 2007 13:17:05 -0600
  • Thread-topic: Dumb Finder scripting question

On 12/13/07 9:04 PM, "Mark J. Reed" <email@hidden> wrote:

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

You mean something based on a construct like this?

set displayed_name to (text items 1 thru -5 of "moviefile.avi") as Unicode
text?

Or is that precisely what you're trying to avoid?

--
Laine Lee


 _______________________________________________
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

References: 
 >Dumb Finder scripting question (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Opening the newest file in a folder
  • Next by Date: Determine if a Word Document is New or Saved
  • Previous by thread: Dumb Finder scripting question
  • Next by thread: Re: Dumb Finder scripting question
  • Index(es):
    • Date
    • Thread