• 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: [late reply] Re: Parameters for "path to" Command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [late reply] Re: Parameters for "path to" Command


  • Subject: Re: [late reply] Re: Parameters for "path to" Command
  • From: Christopher Nebel <email@hidden>
  • Date: Sat, 24 Aug 2002 18:52:34 -0700

On Saturday, August 24, 2002, at 12:59 AM, Michelle Steiner wrote:

On Friday, August 23, 2002, at 08:30 PM, Christopher Nebel wrote:

The bug in this case is that 'alias ":"' produces a very different result (the startup disk) than 'file specification ":"' (the current application's container)

And that container may be inside a package.

set a to ":"
file specification a

--> file "Dora:Applications:AppleScript:Script Editor.app:Contents:MacOS:"

Right, because it's the path to the actual executable, not the root of the bundle. (Yet another thing that "path to current application" shields you from.)

But why is it calling a folder a file?

Well, that's sort of an implementation accident -- it's always worked that way. The classes built in to AppleScript don't make any distinction between files and folders, the same way that the internal FSSpec type that "file specification" is based on doesn't. The name "file" is really a misnomer -- a more accurate name would be "file system object". The rest of the system still knows it's folder, despite what shows up in the result window. For instance:

set f to (choose folder) as file specification
--> file "..." (even though it's a folder)
list folder f
--> {"...", "..." ...} (list folder is fine with it.)
tell application "Finder" to get the class of item f
--> folder


--Chris Nebel
AppleScript Engineering
_______________________________________________
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.

References: 
 >Re: [late reply] Re: Parameters for "path to" Command (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Running Subroutines from Other Scripts
  • Next by Date: Can AS sublaunch based upon Mac OS version?
  • Previous by thread: Re: [late reply] Re: Parameters for "path to" Command
  • Next by thread: Re: [late reply] Re: Parameters for "path to" Command
  • Index(es):
    • Date
    • Thread