Hey guys,
So I’ve found a script that can create folders based on a bunch of quicktimes and then put those quicktimes inside the newly created folders. But I can’t figure out how to do a few other things.
Basically I do VFX work from home, clients send me a gang of quicktime movies, and I want to automate them into a shot folder.
So I would have a folder full of quicktime movies…I want to run a script that generates one folder for each quicktime in the directory. That new folder is named after the quicktime. Inside that new folder, there would be a set of subfolders created. Inside one of the subfolders would be the quicktime movie.
So Example
Quicktime name: HTG101_100_001.mov
Would create the following folders:
Top folder: HTG101_100_001
Inside would be subfolders with items in them including further subfolders.
I could type it all out… but It would be easier to give you an existing blank folder with the structure.
Once all the folders are created, the source quicktime movie, would put itself a few levels deep inside the subfolders in the plates directory.
So far I found this, which makes the folder named after the quicktime, moving the quicktime inside, but I can’t figure out how to build all the sub directories, and have the quicktime reside inside those. Does that make sense?
tell application “Finder”
set selected to selection
set current_folder to item 1 of selected
set mlist to every file of current_folder
set x to mlist
repeat with i from 1 to the count of x
set this_file to item i of x
if i is not 1 then
set previous_file to item (i - 1) of x
set prev_ext to cur_ext
set prev_name to new_name
else
set prev_name to ""
end if
set cur_ext to name extension of this_file
set new_name to text 1 thru -((length of cur_ext) + 2) of (name of this_file as text)
if new_name is not equal to prev_name then
set new_folder to make new folder with properties {name:new_name} at current_folder
move this_file to new_folder
else
move this_file to new_folder
end if
end repeat
end tell
Model: Mac Pro
AppleScript: 2.5
Browser: Safari 537.36
Operating System: Mac OS X (10.12.2)