Re: Prompt to name folder
Re: Prompt to name folder
- Subject: Re: Prompt to name folder
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Wed, 17 Oct 2001 13:17:10 -0500
on 10/17/01 12:33 PM, Bob.Kalbaugh at email@hidden wrote:
>
Here is a script that I have used for a while to help me with my archiving.
The script I provided in my last post is one that I always run with
confidence, however it should have included a trap to restore the
oldArchName property in the event of a cancel in the choose folder routine.
I've altered the script to include it. Here it is.
_blk
Again, watch the line wraps.
-- begin script --
property newArchName : "Blkbook "
property oldArchName : "Blkbook 000" -- first run
property restoreArchName : ""
set restoreArchName to oldArchName
set temp to display dialog "The last archive folder created was named: \"" &
oldArchName & "\"" & return & return &
"Enter a name for the new archive below." default answer newArchName
buttons {"Cancel", "OK"} default button 2 with icon note
if button returned of temp is "OK" then
set oldArchName to text returned of temp
try
set x to (choose folder with prompt "Choose a destination for new
archive:")
tell application "Finder"
set y to make new folder at x with properties {name:oldArchName}
make new folder at y with properties {name:"Audio & Music"}
make new folder at y with properties {name:"Communication"}
make new folder at y with properties {name:"Development"}
make new folder at y with properties {name:"DTP & Graphics"}
make new folder at y with properties {name:"Fun & Games"}
make new folder at y with properties {name:"Interface"}
make new folder at y with properties {name:"Multimedia"}
make new folder at y with properties {name:"Productivity"}
make new folder at y with properties {name:"Programming"}
make new folder at y with properties {name:"Reference"}
make new folder at y with properties {name:"The Kitchen Sink"}
make new folder at y with properties {name:"Updates"}
make new folder at y with properties {name:"Utilities"}
make new folder at y with properties {name:"Web Tools"}
end tell
on error
set oldArchName to restoreArchName
end try
end if
-- end --