Hi aepasieka, James
hope you don’t mind me butting in, and looking at the folder creation script.
I noticed that the creative folk could just as easily put letters in the place of the project numbers and the script would not catch it.
Also I think putting the project number into the default answer is asking for it to be over typed, especially as any text in the default answer is highlighted.
This script should take care of that, (I hope)
property charlist : {"a", "", "b", "", "c", "", "d", "", "e", "", "f", "", "g", "", "h", "", "i", "", "j", "", "k", "", "l", "", "m", "", "n", "", "o", "", "p", "", "q", "", "r", "", "s", "", "t", "", "u", "", "v", "", "w", "", "x", "", "y", "", "z"} --Make a choice for server folder type--
display dialog ¬
"Select New Project to Start or Cancel Process" buttons {"New Project", "Cancel"}
set the button_pressed to the button returned of the result
--To make New Project server--
if the button_pressed is "New Project" then
-- Prompt for a sufix.
set this_itemchar to true
set the_dialog to "Please enter a job number for the project folder names."
(* Prompt for a sufix. and check only numbers are entered *)
repeat until this_itemchar is not true
set this_itemchar to false
set sufix to text returned of (display dialog the_dialog default answer "" with icon note)
set sufixChars to characters of sufix
repeat with i from 1 to number of items in sufixChars
set this_itemchar to item i of sufixChars
if this_itemchar is in charlist then
set this_itemchar to true
set the_dialog to "Sorry You Must Only Enter a Number" & return & "Please enter a job number for the project folder names."
exit repeat
end if
end repeat
end repeat
if sufix does not start with "-" then set sufix to "-" & sufix
-- Use a "Save as." dialog to set the name and location for this project folder.
set parentFolder to (choose file name with prompt "Enter a Folder Name & Pick a Destination, for job number " & sufix default name ("Enter Folder Name Here")) as string
set parentPosix to quoted form of POSIX path of parentFolder as string
set sufixChar to (count of characters of sufix) + 1
set thend to characters -sufixChar thru -2 of parentPosix as string
if thend is not sufix then set parentPosix to quoted form of POSIX path of (parentFolder & sufix as string)
-- Assemble the mkdir command.
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ""
set mkdirStr to {"mkdir -p ", parentPosix, "/", "{Comps,Copy,Images,Collected,Reference,PDF}"} as Unicode text
set AppleScript's text item delimiters to astid
-- Create the folders.
do shell script mkdirStr
(* show folder *)
tell application "Finder"
activate
try
reveal alias (parentFolder as Unicode text)
on error
try
reveal alias (parentFolder & sufix as Unicode text)
end try
end try
end tell
end if