Hi list,
Sorry to interrupt with a noob question. I'm trying update my sfx database, and thought that I could use the gracenote database via itunes for this. This is a lot of files, 500 gb of audio wav, and i don't - for obvious reason - want to do all this manually. Therefore i'm trying to develop a script that wiil do this. I got this to work when i select a single folder. That script looks like this:
set folderSelected to choose folder "Select a folder" set DokumentNavn to "Macintosh HD:Users:rasmus:desktop:a" set DokumentNavn2 to POSIX path of DokumentNavn
tell application "Finder" to set {folderName, sourceList} to {name of folderSelected, (items of folderSelected) as alias list}
tell application "Toast Titanium" activate set myDisc to make Audio disc set (name of myDisc) to folderName add to myDisc items sourceList save myDisc as disc image DokumentNavn delay 2 mount image DokumentNavn2 end tell
tell application "iTunes" activate end tell
But what I'd really want is to do a script that will allow me to choose a folder which contains a lot of sub folders and have those run thru the above routine one by one.I''ve come up with this, but i doesn't work as i expect:
set counter to 1 set ToastCounter to 1 set folders1 to choose folder
set folders2 to items of folders1 as list
set foldercount to length of folders2
repeat foldercount times set folderSelected to item counter of folders2 set DokumentNavn to "Macintosh HD:Users:rasmus:desktop:a" set DokumentNavn2 to POSIX path of DokumentNavn tell application "Finder" to set {folderName, sourceList} to {name of folderSelected, (items of folderSelected) as alias list}
tell application "Toast Titanium" activate set myDisc to make Audio disc set (name of myDisc) to folderName add to myDisc items sourceList save myDisc as disc image DokumentNavn delay 2 mount image DokumentNavn2 end tell
tell application "iTunes" activate delay 30 end tell
set counter to counter + 1 set ToastCounter to ToastCounter + 1
if ToastCounter = 10 then tell application "Toast Titanium" quit set ToastCounter to 1 end tell end if end repeat
Can one of you tell me where I'm wrong with this script. Keep in mind that i don't understand some basic concept of applescript so be gentle ;)
Looking forward to your response!
Best regards, Rasmus Kreiner
|