• 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: Resolving an alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Resolving an alias (From: Thomas Fischer <email@hidden>)

  • Prev by Date: Re: Resolving an alias
  • Next by Date: Re: Resolving an alias
  • Previous by thread: Re: Resolving an alias
  • Next by thread: re: fubar in applescript
  • Index(es):
    • Date
    • Thread