Re: Help with applescript creating folders
Re: Help with applescript creating folders
- Subject: Re: Help with applescript creating folders
- From: "Houston, Brad" <email@hidden>
- Date: Fri, 03 Aug 2007 09:20:52 -0700
- Thread-topic: Help with applescript creating folders
Title: Re: Help with applescript creating folders
This works.
Changed “set temp_name to this_name” to “set temp_name to this_name as string” and “make new folder at new_folder with properties {name:temp_name}” to “make new folder at design_folder with properties {name:temp_name}”.
Brrad
property subf_names : {"Design", "Based On", "Artwork"}
property subg_names : {"Stage 1"}
--
display dialog "Enter job name:" default answer "job name"
set j_name to text returned of result
repeat
display dialog "Enter job number:" default answer "0"
set j_number to text returned of result
try
if (j_number as integer) < 100000 and ¬
(j_number as integer) > -1 then exit repeat
on error
display dialog "Error: enter an integer less than 100,000."
end try
end repeat
set job_number to text -6 thru -1 of ("0000" & j_number & "_")
set temp_name to job_number & j_name
tell application "Finder"
global design_folder
set main_folder to (make new folder at desktop with properties ¬
{name:temp_name}) as alias
repeat with this_name in subf_names
display dialog this_name
set temp_name to this_name as string
set new_folder to (make new folder at main_folder with properties {name:temp_name})
if temp_name is "Design" then set design_folder to new_folder
end repeat
end tell
tell application "Finder"
global design_folder
set chosen_folder to job_number & j_name
repeat with this_name in subg_names
set temp_name to this_name
make new folder at design_folder with properties {name:temp_name}
end repeat
end tell
On 8/3/07 8:23 AM, "Tim Rycroft" <email@hidden> wrote:
Hi all,
I’m trying to create an Applescript which creates a set of folders. The main folder with a job number and job name on and then the folders inside the main folder are Design, Based On, Artwork. I have done all of this which works fine, however I need to add “Stage 1” inside the Design folder and I am having problems doing this. This is one of my earlier versions which works but adds the Stage 1 inside the main folder and not the design folder. Can anyone help me please?
property subf_names : {"Design", "Based On", "Artwork"}
property subg_names : {"Stage 1"}
--
display dialog "Enter job name:" default answer "job name"
set j_name to text returned of result
repeat
display dialog "Enter job number:" default answer "0"
set j_number to text returned of result
try
if (j_number as integer) < 100000 and ¬
(j_number as integer) > -1 then exit repeat
on error
display dialog "Error: enter an integer less than 100,000."
end try
end repeat
set job_number to text -6 thru -1 of ("0000" & j_number & "_")
set temp_name to job_number & j_name
tell application "Finder"
set main_folder to (make new folder at desktop with properties {name:temp_name}) as alias
repeat with this_name in subf_names
set temp_name to this_name
make new folder at main_folder with properties {name:temp_name}
end repeat
end tell
tell application "Finder"
set chosen_folder to job_number & j_name
repeat with this_name in subg_names
set temp_name to this_name
make new folder at main_folder with properties {name:temp_name}
end repeat
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden