• 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: Making a folder in the user's library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a folder in the user's library


  • Subject: Re: Making a folder in the user's library
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 4 Apr 2003 18:02:01 -0800

On Thursday, April 3, 2003, at 05:31 PM, John Baltutis wrote:

You could also do it shorter and more resiliently by using "path to" and the Finder. "path to" knows about where various special folder are, and will create them if they don't exist,

Neat trick, creating things that don't exist. Where is this capability documented? I didn't know that and that's why I checked for its existence using the shell script.

It seems this isn't documented anywhere, even in the old Scripting Additions Guide. (However, I know that people rely on this behavior, because we got a bunch of reports when we accidentally broke it in 1.7!)

Note that it doesn't work, except for those special folders. When I tried this:

set appSupport to folder (((path to the application support folder from the
user domain) as string) & "myFolder")

I got this error:->"Finder got an error: Can't get folder \"John's JAG
Mac:Users:baltwo:Library:Application Support:myFolder\"."

A bit inconsistent, isn't it? Apparently, it's not tied to the folder call,
but the folder/path to combo. Any more words on how it works?

You seem to misunderstand how much "path to" is responsible for. Notice your placement of parentheses -- the "path to" part is simply 'path to the application support folder from the user domain'. That's it. Anything else is not under "path to"'s control, and is not subject to the auto-creation feature. Therefore, since myFolder doesn't exist yet, the Finder gives you an error trying to get it.

On Thursday, April 3, 2003, at 05:52 PM, Paul Berkowitz wrote:

'path to' has got absolutely nothing to do with the Finder, and shouldn't be used in a Finder tell block. (well, back in OS 9, it could lead to trouble.)

It's true that "path to" is not tied to the Finder. Claims that it's dangerous to use it inside a Finder tell block are somewhat exaggerated. The problem is that Finder terms and "path to" selectors conflict in two places, "startup disk" and "desktop", so you can't use "path to" either of them inside a Finder tell block, but other selectors work fine.

(Special folders have been known to move.)

But, if you move the Application Support folder onto the desktop and run the scripts, they will create a new Application Support folder in the users Library. At least that's what I did to test this little puppy. So, location might be important (or this may be a bug). If the latter, let me know and
I'll file the appropriate bug.

On Thursday, April 3, 2003, at 05:52 PM, Paul Berkowitz wrote:

That's not what Chris meant. He meant that a later OS revision/upgrade just
might move one of the special folders to a different location than it
presently occupies. If _you_ move it, it's no longer a special folder, just
a regular folder.

Right.


--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.

References: 
 >Re: Making a folder in the user's library (From: John Baltutis <email@hidden>)

  • Prev by Date: Re: Making a folder in the user's library
  • Next by Date: List folder crashing bug
  • Previous by thread: Re: Making a folder in the user's library
  • Next by thread: Re: Making a folder in the user's library
  • Index(es):
    • Date
    • Thread