• 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: Creating Nested Folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating Nested Folders


  • Subject: Re: Creating Nested Folders
  • From: kai <email@hidden>
  • Date: Thu, 29 Sep 2005 22:53:58 +0100


On 29 Sep 2005, at 19:12, Richard Patterson wrote:

I am having trouble creating nested folders. I can create and rename four folders with the following script:

tell application "Finder"
    set shotFolder to make new folder at location_folder
    set name of shotFolder to (item 1 of nameList)
    set scansFolder to make new folder at location_folder
    set name of scansFolder to (item 2 of nameList)
    set rendersFolder to make new folder at location_folder
    set name of rendersFolder to (item 3 of nameList)
    set elementsFolder to make new folder at location_folder
    set name of elementsFolder to (item 4 of nameList)
end tell

but I want to put the last three folders inside the first. I have tried everything I can think of.

You can make a new folder and name it in one hit, Richard:

----------

set location_folder to path to desktop (* for example *)
set nameList to {"shot folder", "scans folder", "renders folder", "elements folder"}


tell application "Finder"
set shotFolder to make new folder at location_folder with properties {name:item 1 of nameList}
set scansFolder to make new folder at shotFolder with properties {name:item 2 of nameList}
set rendersFolder to make new folder at shotFolder with properties {name:item 3 of nameList}
set elementsFolder to make new folder at shotFolder with properties {name:item 4 of nameList}
end tell


----------

Alternatively, if you have no further use for the individual variable labels:

----------

set location_folder to path to desktop (* for example *)
set nameList to {"shot folder", "scans folder", "renders folder", "elements folder"}


tell application "Finder" to tell (make new folder at location_folder with properties ¬
{name:nameList's beginning}) to repeat with currName in nameList's rest
make new folder at it with properties {name:currName}
end repeat


----------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Creating Nested Folders (From: Richard Patterson <email@hidden>)

  • Prev by Date: Re: make a new folder within an exisitng folder
  • Next by Date: Re: 'inconsistency'
  • Previous by thread: Re: Creating Nested Folders
  • Next by thread: Accessing network folders in AppleScript
  • Index(es):
    • Date
    • Thread