Resolving an alias
Resolving an alias
- Subject: Resolving an alias
- From: Thomas Fischer <email@hidden>
- Date: Fri, 30 Oct 2009 12:43:43 +0100
Hello,
I've been struggling with aliases for a while and didn't find a
solution, so I thought my results may be useful for others.
Please tell me if this is well know or there is a simpler solution.
I must stress that this does *not* refer to the Finder's "alias
file" (for which there is an "original item" property for this
problem), but to the general alias concept of Applescript.
If somebody drops anything on your AppleScript app, your on handler
receives a list of aliases and I was wondering how I could decide if
they were files, folders or anything else. If you have an actual
object, the class of the object tells you this, but for an alias the
class is alias and that doesn't help. To get the class of the
underlying object you want to resolve the alias, but I didn't find a
straight way to do so.
My solution for now is:
set myType to the class of theItem
if myType is alias then
tell application "System Events"
set theProperties to the properties of theItem
set theItem to disk item (the name of theProperties) of (the
container of theProperties)
set myType to the class of theItem
end tell
end if
Is there a more straightforward method for this?
All the best
Thomas
_______________________________________________
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