• 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: question regarding file types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question regarding file types


  • Subject: Re: question regarding file types
  • From: Stan Cleveland <email@hidden>
  • Date: Tue, 12 Sep 2006 12:32:27 -0700
  • Thread-topic: question regarding file types

Title: Re: question regarding file types
On 9/12/06 7:45 AM, Jim Weisbin wrote:

I'm reposting this question because I would really like to understand this better:

Why is it that one can say "set f to audio file f", but cannot say, for example "set f to every audio file of this folder"?

It’s almost certainly a restriction imposed by whatever application you’re using. One would expect that an app that recognizes an “audio file” class would allow you to retrieve or specify its path. But that same app may not include a “folder” class in its dictionary. Some do, but most don’t. If the one you’re using does not, your first command may work, but the second one won’t.

On the other hand, the Finder certainly understands what a “folder” is, but has no “audio file” class in its dictionary. Therefore, neither of your commands will work in the Finder.

How about a hybrid approach that uses both the Finder and the audio application working together, something like this:

tell application "Finder"
    set fileList to document files of folder someFolder whose name ends with ".mp3" or name ends with ".m4a"
end tell
tell
application "Some Audio App"
    repeat with thisFile in fileList
       set thisFile to thisFile as text
       open audio file thisFile
        
–– do something with the file
   end repeat
end
tell

Stan C.
--
This message made with 100% recycled pixels.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: question regarding file types
      • From: Yvan KOENIG <email@hidden>
References: 
 >question regarding file types (From: Jim Weisbin <email@hidden>)

  • Prev by Date: Re: Filemaker Pro 8 question
  • Next by Date: Re: question regarding file types
  • Previous by thread: question regarding file types
  • Next by thread: Re: question regarding file types
  • Index(es):
    • Date
    • Thread