Applescript help

Hi Guy’s

I’m trying to make an applescript that generate folders within eachother. I’ve so far done this script below, but the success rate on people being able to create the folders correctly in the first place is not great as we have a filing convension which people will not stick to. What I now would like to do is have some sort of database, maybe filemaker where the Apple script references certain data within a drop down menus system.
For example if you had these options;

1st table is car manufacturers (The user then selects say Vauxhall out of the list)

2nt table then looks at models (The user then only gets a specific list of models of cars depending on the selection above)

3rd table then breaks this down to 4 Door Vectra Estate or 5 Door hatch etc. (Depending on which option the user selects it will then name the folder where we currently use “Enter Job Name” as Vaux_4DV_Est as this then has the values behind the scenes for selecting 4 Door Vectra Estate)

Is this possible?


property subf_names : {“Psd_Eps_Tiff”, “Design/Stage 1/RT 1/Resource”, “Design/Stage 1/RT 1/PDF”, “Design/Stage 2”, “Based On”, “Artwork”}

display dialog “Enter job name:” default answer “job name”
set j_name to text returned of result
display dialog “Enter job number:” default answer “0”
set j_number to text returned of result
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 (“00000” & j_number & “_”)
set temp_name to job_number & j_name

set theDestinationFolder to choose folder

tell application “Finder”

--set main_folder to (make new folder at desktop with properties {name:temp_name}) as alias
set main_folder to (theDestinationFolder make new folder at theDestinationFolder with properties {name:temp_name}) as alias

end tell

repeat with child in subf_names
do shell script "cd " & quoted form of POSIX path of main_folder & "; mkdir -p " & quoted form of child
end repeat

tell application “Finder”
set tim_file to file “Macintosh HD:Volumes:company name:Clients:Default”
duplicate tim_file to folder “Design:Stage 1:RT 1” of folder main_folder

set name_file to file "" of folder "Design:Stage 1:RT 1" of folder main_folder
set newFile to name_file
set name of newFile to temp_name & ".ai"

end tell


Not sure why you haven’t had too many replies on this one, maybe cause not that many people have Filemaker etc.
What about just creating a few lists in your script to guide the end user towards the details they need.

set t to (choose from list {"Vauxhall", "Ford", "Renault"})
if t is {"Vauxhall"} then
	set j to (choose from list {"Vectra", "Astra", "Sigma"})
	if t is {"Ford"} then
		set j to (choose from list {"Fiesta", "Mondeo", "Ka"})
		if t is {"Renault"} then
			set j to (choose from list {"Clio", "Megane", "Laguna"})
		end if
	end if
end if

Sorry if i’m way off on your request here its just an idea!!
Good Luck

Thank you for your reply. It doesn’t have to be a filemaker database even (if I dare say it) and excel document. Your spot on with how to do it in Applescript, I just wanted it as easy as possible to by modifed by any user rather then me everytime we add a new brand etc

Thanks for your help, might have to use this solution instead.