Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Editing a script (http://www.mac-forums.com/forums/os-x-development-darwin/263867-editing-script.html)

productionman 01-17-2012 10:24 AM

Editing a script
 
HI,

I have a script that creates a job folder which has a number of named folders within it, I'm trying to add more folders to this but having trouble editing the script correctly. Below is the folder layout and in red are the folders I'm trying to create.

[Folder_Name]

With in Folder_name are five folders

Concept
Design
Reference
LR_Proofs(Jpegs/PDFS)
Supplied

Within Design I have a stg1 folder and with in that I want two new folders (PSD, Vector) this is where I'm having trouble.

the script is below if someone could help me out id really appreciate it.


property newFolderName : "Client_Folder"
property mainSubFolderNames : {"Supplied", "Concept", "Design", "Copy", "Reference", "LR_Proofs_(PDFs/JPEGS)"}
property DesignSubFolderNames : {"Stg_1"}
property ConceptSubFolderNames : {"Stg_1"}


repeat
display dialog "Enter job number:" default answer ""
set jobNumber to text returned of result
if result is not "" then exit repeat
end repeat

choose folder with prompt "Create job folder '" & jobNumber & "' _in this folder:"
try
tell application "Finder"
make new folder at result with properties {name:(jobNumber & newFolderName)}
set jobFolder to result as alias

repeat with i from 1 to (count mainSubFolderNames)
make new folder at jobFolder with properties {name:(jobNumber & (item i of mainSubFolderNames))}
end repeat

repeat with i from 1 to (count DesignSubFolderNames)
make new folder at ((jobFolder as text) & jobNumber & "Design:") as alias with properties {name:(jobNumber & "" & (item i of DesignSubFolderNames))}
end repeat

repeat with i from 1 to (count ConceptSubFolderNames)
make new folder at ((jobFolder as text) & jobNumber & "Concept:") as alias with properties {name:(jobNumber & "" & (item i of ConceptSubFolderNames))}
end repeat
end tell

on error errorMsg number errorNum
display dialog "Error: (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1
end try



Thanks


All times are GMT -4. The time now is 03:13 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.