Hello all, thanks for taking the time to read this!
Basically, I’m trying to assemble a script that runs the following logic on a folder/selection of folders, either via a drag and drop applet or multiple manual selections:
Script Logic******
It looks in the specified folder(s) for any folders/subfolders (no matter how deep) with the name “Outlined”, and if it finds any, it copies all the files inside that/those folders to a pre-determined location. (A folder on the desktop).
That’s about it. I was able to cobble together a script which would run successfully with one folder that I had to manually target with a prompt, but it failed both as a droplet and when I tried to run it on multiple folders at once. I unfortunately don’t have that hacked code with me at the moment, but it was based off this piece of coding that I found:
tell application “Finder”
set theFiles to a reference to every file of (entire contents of folder “old:folder:path”)
duplicate theFiles to folder “new:folder:path”
end tell
In case it’s of use, here’s a little more background/specifics on what I’m trying to do:
My company’s software auto-generates folders per job with the following structure: (Parens indicate a folder)
(JobName)
–(Outlined)
–>–JobName.pdf
–(Web)
–>–JobName web.pdf
–JobName Report.pdf
There’s literally hundreds of these folders generated a day, and the only document that I’m generally interested in out of that is the JobName.pdf, in this example. So what I’m trying to do is point a script at either specific ‘JobName’ directories (in multiple) or occasionally point it at the top-level directory to parse through everything inside. And it would extract that particular file (which can only uniquely be found by the name of its parent folder, ‘Outlined’) into, as I said, a pre-existing folder on the desktop.
I hope that was clear, and thanks in advance if anyone has any advice on how I can proceed!