Re: Alias list inconsistency ?
Re: Alias list inconsistency ?
- Subject: Re: Alias list inconsistency ?
- From: Philip Aker <email@hidden>
- Date: Thu, 26 Jun 2008 02:21:14 -0700
On 08-06-25, at 23:38, Jay Louvion wrote:
Try this little snippet and please tell me there is a reason to (what seems like) this nonsense. tell application "Finder" set ImageFiles to (every file of folder (choose folder)) if length of ImageFiles is 1 then set ImageFiles to ImageFiles as alias else display dialog "There is more than one file." set ImageFiles to (ImageFiles as alias list) end if end tell
The result when there are more than one file is not returned as an alias list, but as a list of file references, Finder-style.
tell application "Finder" set ImageFiles to (every file of (choose folder)) as alias list end tell
If you always output as an alias list, then you've got consistent behavior.
set fold to (choose folder) tell application "System Events" path of every file of fold whose visible is true and type identifier is "public.jpeg" end tell
Not an alias list, but if you have to iterate through them at any point, each path is convertible to an alias. If you can, use System Events, for your file stuff because it's behavior is more consistent with the element and properties design favored on OS X whereas the Finder has 15 years of legacy to work around. Philip Aker
Democracy: Two wolves and a sheep voting on lunch.
|
_______________________________________________
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