~rogeruiz/Job-Folder-Creation

4cbf574a67508d7e40673d598ea5e7cbcf8869d4 — Roger Steve Ruiz 11 years ago
My first AppleScript. Used to create folders for jobs at work.
1 files changed, 39 insertions(+), 0 deletions(-)

A Indigo Job Folder Creator.applescript
A  => Indigo Job Folder Creator.applescript +39 -0
@@ 1,39 @@
set thePath to choose folder with prompt "Please select the Indigo Preflight folder:"
tell application "System Events"
	set selectedPath to get the name of thePath
end tell
if selectedPath is "Indigo Preflight" then
	set userCanceled to false
	try
		set startNumDialog to display dialog �
			"Please enter the first Indigo job number:" buttons {"Cancel", "OK"} �
			default button "OK" cancel button �
			"Cancel" default answer ""
	on error number -128
		set userCanceled to true
	end try
	try
		set endNumDialog to display dialog �
			"Please enter the last Indigo job number:" buttons {"Cancel", "OK"} �
			default button "OK" cancel button �
			"Cancel" default answer ""
	on error number -128
		set userCanceled to true
	end try
	
	if userCanceled then
		display dialog "You have canceled the creation of Indigo job folders. Please relauch the application to try again."
	else if button returned of startNumDialog is "OK" and button returned of startNumDialog is "OK" then
		set startNum to text returned of startNumDialog
		set endNum to text returned of endNumDialog
		tell application "Finder"
			activate
			repeat with i from startNum to endNum
				make new folder at thePath with properties {name:i}
			end repeat
		end tell
		
	end if
else
	display alert "You must selected the Indigo Preflight folder in tekserver://AppendIT/Tek-Po's/Indigo Preflight/"
end if
\ No newline at end of file