Page 1 of 1

Move to a folder - Name of the folder is a variable

PostPosted: Sun Sep 24, 2017 8:05 am
by KevinCork
Hi,

I want to move documents when the folder is the name of the current year.

I suppose I can set the patch with an AppleScript

set correctpatch to POSIX file "/Users/user/Box Sync/Documents/Finances/Bills/Electricity/"
tell (current date)
set stryear to (its year as integer)
end tell
set correctpatch to POSIX file correctpatch & stryear & "/" as text

however how to I move the file to this patch ?

Edit : I suppose I just have to ignore the move option and move it through the Apple Script

Re: Move to a folder - Name of the folder is a variable

PostPosted: Mon Sep 25, 2017 11:18 am
by Mr_Noodle
No script is needed. Use Sort into subfolder and drag in "Current year". Edit the format to only include the year.

Re: Move to a folder - Name of the folder is a variable

PostPosted: Mon Sep 25, 2017 12:16 pm
by KevinCork
Mr_Noodle wrote:No script is needed. Use Sort into subfolder and drag in "Current year". Edit the format to only include the year.


That's perfect, thank you !

Re: Move to a folder - Name of the folder is a variable

PostPosted: Thu Sep 28, 2017 12:14 pm
by dlehman
Is this possible though-- to use the output of an AppleScript to create a folder name to sort into?

I archive my expense receipts weekly. If I have an AppleScript that computes the date of "this friday", can I somehow use that as the folder name? (eg. "Receipts - 2017-09-29")

Re: Move to a folder - Name of the folder is a variable

PostPosted: Fri Sep 29, 2017 10:26 am
by Mr_Noodle
Check the help on AppleScript. The script can export attributes back out to Hazel for it to use.