New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Editing a script


Post Reply New Thread Subscribe

 
Thread Tools
productionman

 
Member Since: Jan 17, 2012
Posts: 1
productionman is on a distinguished road

productionman is offline
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
QUOTE Thanks

Post Reply New Thread Subscribe


« shortcut, for example, my email address? | Slightly Better authorization sample fails only in Leopard »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Mapping AFP with Applescript for student macs DrunkMunki OS X - Operating System 3 11-04-2011 02:23 AM
Script for Zoom in MS Office Word 2008 or 2011 Lbatson21 OS X - Apps and Games 1 10-31-2011 10:39 PM
Script to duplicate Apple Lossless iTunes library as MP3 files nick_harambee OS X - Operating System 10 10-02-2010 08:53 AM
need help to amend a script so that it only runs if iTunes is running nick_harambee OS X - Operating System 1 07-20-2009 11:15 AM
apple script to greet me off stand by jakeroberts OS X - Development and Darwin 0 04-29-2007 12:34 PM

All times are GMT -4. The time now is 02:34 AM.

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

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?