set JobBagName to (the clipboard as text) set AppleScript's text item delimiters to {" ", ".", ":", ";", "-", ","} set finalName to text items of JobBagName set AppleScript's text item delimiters to "_" set JobBagName to finalName as string set newName to result as text set AppleScript's text item delimiters to {"___"} set new to text items of newName set AppleScript's text item delimiters to "_" set newName to new as string set newName1 to result as text set AppleScript's text item delimiters to {"__"} set new2 to text items of newName1 set AppleScript's text item delimiters to "_" set newName1 to new2 as string
display dialog "Name of New Job Bag - Nouveau Dossier" default answer newName1 buttons {"OK", "Cancel"} default button 1 copy the result as list to {text_returned, button_pressed} set JobBagFinalName to text_returned choose folder with prompt "Select Folder for Job Folder Creation - Destination du Nouveau Dossier" set destination to result set posix_Dest to POSIX path of destination tell application "Finder" make folder with properties {name:JobBagFinalName} at destination set TheNewJobBag to result make folder with properties {name:"SourcesClient_" & text_returned} at TheNewJobBag open TheNewJobBag end tell |