Copying files into specified folders

Ok I have a script that makes folders now I need to add to that so I can copy a file from one location into one of the folders. Thanks in advance


on run
tell application "Finder"
activate
set job_number to text returned of (display dialog "Enter the Job Number:" default answer "" buttons {"Cancel", "Ok"} default button 2 with icon 1)
set job_name to text returned of (display dialog "Enter the Job Name:" default answer "" buttons {"Cancel", "Ok"} default button 2 with icon 1)
set the new_folder to make new folder at folder "Raid_4" with properties {name:{job_number & " " & job_name}}
open new_folder
make new folder at the new_folder with properties {name:(job_number & " EPS")}
make new folder at the new_folder with properties {name:(job_number & " IMPO WEB")}
make new folder at the new_folder with properties {name:(job_number & " IMPO SHEET")}
make new folder at the new_folder with properties {name:(job_number & " FPO")}
set the new_folder to make new folder at the new_folder with properties {name:(job_number & " Digital Paperwork")}
make new folder at the new_folder with properties {name:(job_number & " Preflight")}
copy {folder:Raid_0:RCP_DigitalForms: SHT Checklist_Rev 2} to "job_number & Preflight"
end tell
end run

Try this for the last couple of lines before the “end tell”. Check the file path to make sure that I didn’t hose it.

set preflight_fol to (make new folder at the new_folder with properties {name:(job_number & " Preflight")})
duplicate alias "Raid_0:RCP_DigitalForms:SHT Checklist_Rev 2" to preflight_fol

– Rob

That works perfect…any chance you can also help me wiht adding the job number to those files we duplicated and transfered?

Jason

I also need to unlock the files before they are altered.

Jason

Replace the line that duplicates the file with this.

set duped to (duplicate alias "Raid_0:RCP_DigitalForms:SHT Checklist_Rev 2" to preflight_fol)
set locked of duped to false
try
	set name of duped to ((name of duped) & "_" & job_number)
on error e
	display dialog e buttons {"OK"} default button 1 with icon 0
end try

Is that close to what you need?

– Rob

Thank you, Rob :lol: