• 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: Alias list inconsistency ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
echo email@hidden@nl | tr a-z@. p-za-o.@

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

References: 
 >Alias list inconsistency ? (From: Jay Louvion <email@hidden>)

  • Prev by Date: Re: Alias list inconsistency ?
  • Next by Date: Re: strange behaviour of QT Player 7.5 when setting window bounds
  • Previous by thread: Re: Alias list inconsistency ?
  • Next by thread: Re: Alias list inconsistency ?
  • Index(es):
    • Date
    • Thread