Help Needed

Hello

Sorry about this question Im a bit of a newbie and not really sure how to do this, so any help would be greatly appreciated.

This is what Im trying to do.
I have a group of artists all creating seperate indesign files this are then sent to Distiller to create a PDF from them.
These files are then manually located in corresponding folders located on the server. Now what Im trying to do is automate this process.

As an example here one of the file names
06_019_41C_757730_AB_982X180_LR.pdf

Now here comes the difficult bit What I need to do is as follows
First locate the correct week number folder from this part of the file name 41 (can be anything from 1 to 53), then within that folder locate the correct group (first two digits = 06) this could be anything from 01 to 90 and then locate the correct folder for the size of item (982x180) also could be anything.
Once this folder has been located then move the item into the correct folder.

Hopefully someone can explain this to me or give me an example script that I can play with.

Thanks in advance

Scott

Model: Macbook Pro
AppleScript: 2.2.1
Browser: Safari 528.16
Operating System: Mac OS X (10.5)

This example obviously doesn’t automate the process rather it asks you to select the PDF to file and the root server folder. From there is destructs the file name and places it in the appropriate place. This should give you a base to start with in automating your entire process.

set thePDF to choose file
set theServer to (choose folder) as Unicode text

set {tid, text item delimiters} to {text item delimiters, "_"}
tell application "Finder"
	set {theGroup, na, theWeek, na, na, theSize, na} to text items of (get name of thePDF)
	move thePDF to folder (theServer & (text 1 thru 2 of theWeek) & ":" & theGroup & ":" & theSize & ":")
end tell
set text item delimiters to tid

This is brilliant thanks very much for this.

I only have one question though, I forgot to state in the first post the the Week folder name on the server has Week in front of it ie: Week41.

Sorry but how do I add this into the script

Like so

set thePDF to choose file
set theServer to (choose folder) as Unicode text

set {tid, text item delimiters} to {text item delimiters, "_"}
tell application "Finder"
	set {theGroup, na, theWeek, na, na, theSize, na} to text items of (get name of thePDF)
	move thePDF to folder (theServer & "Week" & (text 1 thru 2 of theWeek) & ":" & theGroup & ":" & theSize & ":")
end tell
set text item delimiters to tid

Thanks for the quick response

I had the Week in the wrong place

So thanks for pointing me in the right direction

No problem!! :smiley:

Fantastic! :smiley:

oO

Is there a way to get this script to choose the first item of a specific folder? I tried changing ‘choose file’ to ‘the selection’ after scripting the Finder to select the file, but the script doesn’t like that at all.

Oh yes, I am a complete novice.