Hi All,
Please go easy on me as this is my first post:
I am trying to write a script to generate a folder hierarchy automatically. (My OS Version 10.4.11)
(Ultimately I want this to become a discreet module that can be passed parameters and used by other higher level modules so I don’t have to worry about the working details every time.)
For now though, I am having real difficulties even capturing and using references to folders/finder items. On searching google I found the following thread which looks to be the sort of thing I am after:
http://forums.macosxhints.com/archive/index.php/t-70505.html
The following method looks interesting but unfortunately doesn’t seem to work:
set theLocation to <alias of path to where you want the folder> --this was replaced with path to desktop as alias
tell application "Finder"
set archiveFolder to make new folder at theLocation with properties {name:"ARCHIVE"}
set assetsFolder to make new folder at archiveFolder with properties {name:"ASSETS"} --script fails on this line: -->Finder Can't get some object
set FPOFolder to make new folder at assetsFolder with properties {name:"FPO Images"}
set HiResFolder to make new folder at assetsFolder with properties {name:"Hi-Res Images"}
set illustratorFolder to make new folder at assetsFolder with properties {name:"Illustrator Assets"}
set logoFolder to make new folder at assetsFolder with properties {name:"Logos"}
set copyFolder to make new folder at archiveFolder with properties {name:"Copy"}
set layoutFolder to make new folder at archiveFolder with properties {name:"LAYOUTS"}
set setFolder to make new folder at archiveFolder with properties {name:"OK TO SET", label index:2}
set pdfFolder to make new folder at archiveFolder with properties {name:"PDF"}
end tell:
On studying the event log, it seems that the chain of "of"s seems to be clipped, i.e the path only extends to the current user folder, and cuts off there:
e.g. archiveFolder becomes: folder “ARCHIVE” of folder “Desktop” of item “”…no more path.
I’ve been reading Applescript the Definitive Guide, and Applescript The Comprehensive Guide to Scripting… I still can’t seem to find the correct way to do this sort of thing though…
Can anyone elucidate this one for me?
Thanks in advance for replies, it’s driving me mad!!!