• 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
Alias List not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Alias List not working


  • Subject: Alias List not working
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 01 Sep 2009 11:09:38 -0500

I've been experimenting with this script trying to find why a variable that should be an alias ... isn't.

tell application "Finder"
activate
try
set sourceFolder to (target of window index 1) as alias
on error
beep
return
end try
if class of item sourceFolder is not folder then return
--
set itemList to (get items of sourceFolder as alias list)
-- set itemList to (sort itemList by modification date) -- line 1
-- set itemList to reverse of itemList as alias list -- line 2


set itemList to (itemList as alias list)


set itemAlias to (item 1 of itemList) -- as alias -- line 3
(class of itemAlias)
display dialog the result as text

end tell


If you run this "as is", the dialog shows "alias".

But, if you run it with the two commented-out lines restored, the dialog shows "folder" or "document file" & c. Further, I am not able to coerce the list to an alias list by using

set itemList to (itemList as alias list)

but I can restore the 'as alias' in line 3 to get what I need.

The problem seems to be line 1. If only line 1 is commented-out, you get correct behavior.

It seems that a 'sorted' list of references cannot be coerced to a list of aliases.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Alias List not working
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: Bug 4239921
  • Next by Date: Mail.app Schedules
  • Previous by thread: Re: Bug 4239921
  • Next by thread: Re: Alias List not working
  • Index(es):
    • Date
    • Thread