• 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: Andrew Oliver <email@hidden>
  • Date: Mon, 31 Mar 2003 00:50:14 -0800

This is quite simple.

The 'path to' command will give you the location of a number of 'blessed'
directories, including Application Support:

You can use the result of the path to command to tell the Finder where to
make the new folder.

set appSupportPath to path to application support from user domain
tell application "Finder"
make new folder at appSupportPath with properties {name:"MyFolder"}
end tell

Note, if you want the *system* Application Support directory (typically
/Library/Application Support/", remove the 'from user domain' part of the
path to command. The 'user domain' element makes sure you get the user's own
/Library path.

As for creating multiple levels of folders, you have to make them one at a
time. You can use the 'exists' command to test for the existence:

set appSupportPath to path to application support from user domain
tell application "Finder"
if exists folder ((appSupportPath as string) & "MyFolder") then
-- folder exists, so copy files, or whatever
else
make new folder at appSupportPath with properties {name: "MyFolder"}
end if
end tell

Andrew
:)
On 3/30/03 11:54 PM, "Jeffrey Mattox" <email@hidden> wrote:

> I want to make a folder, "myFolder", in the current user's
> Library/Application Support folder, creating the Application Support
> folder, if necessary. I know how to script the Finder to make
> folders on the desktop, but I'm stuck when working in the library.
>
> I'm having problem dealing with (1) accessing the library folder and
> (2) testing for and creating folders several levels deep. How do I
> do this?
>
> Jeff
> _______________________________________________
> 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.
_______________________________________________
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: Making a folder in the user's library
      • From: Paul Berkowitz <email@hidden>
References: 
 >Making a folder in the user's library (From: Jeffrey Mattox <email@hidden>)

  • Prev by Date: Re: Making a folder in the user's library
  • Next by Date: Re: Non-AppleScript access to GUI scripting (System Events) plug-in?
  • 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