Re: Resolving an alias
Re: Resolving an alias
- Subject: Re: Resolving an alias
- From: Luther Fuller <email@hidden>
- Date: Fri, 30 Oct 2009 11:45:04 -0500
On Oct 30, 2009, at 6:43 AM, Thomas Fischer wrote:
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.
We recently discussed this. In Snow Leopard, the list of dropped items
is a list of «class bmrk». In a previous system (Tiger), this is a
list of aliases. Always use aliases.
If you need to know what kind of item the alias points to (e.g. is it
a folder or not), use 'class of item ...'.
Just an example, but your script may look something like this ...
on open dropList
repeat with dropItem in dropList
set dropAlias to dropItem as alias
tell application "Finder"
if (class of item dropAlias) is folder then
_______________________________________________
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