• 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: Adding a subfolder to an array of folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a subfolder to an array of folders


  • Subject: Re: Adding a subfolder to an array of folders
  • From: email@hidden
  • Date: Thu, 23 Jul 2009 05:52:02 -0700

Thanks Philip - obviously it is more complicated than just adding a line in the script.
 
I cannot get your changes to work on their own in Script Debugger (after removing or adapting the FileMaker parts) and I cannot incorporate them into my script, which I should have provided completely in the first place:
 

property subf_names : {"00 Folder", "01 Folder", "02 Folder", "03 Folder", "04 Folder", "05 Folder", "06 Folder", "07 Folder",“08 Folder”}

set TNumber to cell "TNumber" of current record

set MonthDate to cell "MonthDate" of current record

set RecRef to cell "RecRef" of current record

set Ref_id to TNumber & " " & RecRef

set temp_name to Ref_id

set temp_disc to Ref_id

set theAlias to alias "MyMac:Work"

tell application "Finder"

set main_folder to (make new folder at theAlias with properties {name:temp_name}) as alias

repeat with this_name in subf_names

set temp_name to this_name

make new folder at main_folder with properties {name:temp_name}

end repeat

end tell


 
On Thu, 23 Jul 2009 04:24 -0700, "Philip Aker" <email@hidden> wrote:
On 2009-07-23, at 02:53:37, email@hidden wrote:

I have this line, which works"

property subf_names : {"01 Folder", "02 Folder", "03 Folder", "04
Folder", "05 Folder", "06 Folder", "07 Folder"}

but it doesn't if I try (various attempts) to add subfolders to 03 and
06. Do I need to add an extra line(s) after this specifying the two main
folders?
 
 
property subs : {"01 Folder", "02 Folder", "03 Folder", "04 Folder", "05 Folder", "06 Folder", "07 Folder"}
 
set end of subs to "08 Folder"
subs
--> {"01 Folder", "02 Folder", "03 Folder", "04 Folder", "05 Folder", "06 Folder", "07 Folder", "08 Folder"}
 
repeat with i from 1 to count of subs
set s to item i of subs
if (s is "03 Folder") then
set item i of subs to {s, {"03.1 Folder", "03.2 Folder"}}
else if (s is "06 Folder") then
set item i of subs to {s, "06.1 Folder", "06.2 Folder"}
end if
end repeat
subs
--> {"01 Folder", "02 Folder", {"03 Folder", {"03.1 Folder", "03.2 Folder"}}, "04 Folder", "05 Folder", {"06 Folder", "06.1 Folder", "06.2 Folder"}, "07 Folder", "08 Folder"}
 
set item 7 of subs to {item 7 of subs, {"07.1 Folder", "07.2 Folder"}}
subs
-- {"01 Folder", "02 Folder", {"03 Folder", {"03.1 Folder", "03.2 Folder"}}, "04 Folder", "05 Folder", {"06 Folder", "06.1 Folder", "06.2 Folder"}, {"07 Folder", {"07.1 Folder", "07.2 Folder"}}, "08 Folder"}
 
 
 
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Adding a subfolder to an array of folders
      • From: Philip Aker <email@hidden>
References: 
 >Adding a subfolder to an array of folders (From: email@hidden)
 >Re: Adding a subfolder to an array of folders (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Adding a subfolder to an array of folders
  • Next by Date: Re: Variables pane of Script Debugger
  • Previous by thread: Re: Adding a subfolder to an array of folders
  • Next by thread: Re: Adding a subfolder to an array of folders
  • Index(es):
    • Date
    • Thread