Variable Folder Path AppleScript
Ive been working on a script for nearly a month now! Im still learning basics.
I have been trying to create a script that first reads all the folder names from a folder on the server.
It then takes those names and puts them in a drop down menu as list.
The folder name would be selected, then a dialog box would ask for a new folder name.
The script would then make the new folder in the folder that was selected previously.
Ive cracked the drop down menu part using CocoaDialog.
The problem I have is taking the selected folder and placing that at the end of the folder path.
Now im just getting into a mess with things and im going round and round in circles
So far I have:
set theFolder to alias "Server:folder"
tell application "System Events"
set l to {name of theFolder} & name of folders of theFolder
end tell
set args to ""
repeat with i from 1 to (count l)
set args to args & quoted form of item i of l
if i < (count l) then
set args to args & " "
end if
end repeat
(do shell script "/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog \\
standard-dropdown --title Title --text Text --items " & args)
set {button, answer} to paragraphs of result
if button is "1" then
return item (answer + 1) of l
set JobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
set newfoldername to JobName
set thePath to theFolder & result as text
set newfolder to makenewfolderatthePathwith properties {name:newfoldername}
makenewfolderatnewfolderwith properties {name:"Admin"}
makenewfolderatnewfolderwith properties {name:"Images"}
makenewfolderatnewfolderwith properties {name:"Previous"}
makenewfolderatnewfolderwith properties {name:"Supplied"}
makenewfolderatnewfolderwith properties {name:"PDFs"}
end if
end
Any help would be amazing
Many thanks