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

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

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
KevinCork
 
Posts: 3
Joined: Tue May 05, 2015 9:46 am

No script is needed. Use Sort into subfolder and drag in "Current year". Edit the format to only include the year.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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 !
KevinCork
 
Posts: 3
Joined: Tue May 05, 2015 9:46 am

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")
dlehman
 
Posts: 1
Joined: Thu Sep 28, 2017 12:11 pm

Check the help on AppleScript. The script can export attributes back out to Hazel for it to use.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion