• 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: alias is folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alias is folder?


  • Subject: Re: alias is folder?
  • From: Christopher Nebel <email@hidden>
  • Date: Sun, 27 Apr 2003 22:35:22 -0400

On Sunday, April 27, 2003, at 10:12 PM, matt neuburg wrote:

A more reliable approach is this:

tell application "Finder"
get class of item myAlias --> folder
end tell

Very nice, thank you. I'm not sure I understand why this works. I guess what's happening is that we're coercing the alias to an item, then asking for its lowest-level class (which is why we get folder, not item).

Yes, except that "item myAlias" is an object specifier, not a coercion. Those are two different operations in AppleScript. (You could argue that they should be the same thing, and I have in the past.)

Is there a similar way to ask if myAlias is a container?

Unfortunately, no. That would require the ability to express the idea of "is a kind of", which AppleScript hasn't got. (It should, mind you, but it doesn't.) The best you can do is check for all the concrete container types you know about and hope no new ones show up.


--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: alias is folder?
      • From: John Delacour <email@hidden>
  • Prev by Date: Re: alias is folder?
  • Next by Date: Re: OSX EightyRes ?
  • Previous by thread: Re: alias is folder?
  • Next by thread: Re: alias is folder?
  • Index(es):
    • Date
    • Thread