Alias List not working
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