Page 1 of 1

Get name of destination folder

PostPosted: Sun Mar 29, 2015 9:05 pm
by Mondozer
On the first of the month I want to copy all of the files changed in the last month to a directory /BACKUPS.
Rule One creates a folder /BACKUPS/Mondozer & Current date and time. Got this one figured out.
Rule Two gets all of the files modified in the last month. This works
But I cannot select the folder I created in Rule One in order to run the copy command because It doesn't exist yet.
I created a Custom Attribute in rule One for the new directory but don't see how to pass it to the Do section of Rule two

Rule One:
All
Name matches Applications
Run embedded applescript

set newFolder to "Mondozer BU "
set d to short date string of (current date)
set t to time string of (current date)
tell application "Finder"
set p to disk "Macintosh HD"'s folder "BACKUPS"
make new folder at p with properties {name:newFolder & " " & d & " " & t}
end tell

Add names of any custom attributes this script exports: BU Folder Name

Rule Two:
all
Date Last Modified is after specific date {first of the month}
Kind is not a Folder
Do the following
Copy to folder ?? It falls apart here.


Thanks for your help,
M.

Re: Get name of destination folder

PostPosted: Mon Mar 30, 2015 11:19 am
by Mr_Noodle
Why not use Sort into subfolder? It will file things with a pattern you specify and it will create the folder if needed, making the first rule unnecessary.