Re: question regarding file types
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