Page 1 of 1

Import Name token content / Move to Name token

PostPosted: Sun Jul 19, 2020 4:02 am
by schmudi
Hi,

for invoices I have created one rule per supplier, where I use a name token to check if in the file name the supplier name matches, then use this name token to rename the file and then I have to select the folder with the supplier name (as it is already in the name token) to move the file to this folder.

I assume it would be possible to use AppleScript or JavaScript to import a list of supplier names separate by line break and check those with one single rule instead of creating multiple rules - for each supplier a dedicated one?

As I am not a developer it would be great if somebody had some code snippet in order to start creating and implement such a logic. It would be much easier to maintain the rules and add a new suppliername.

The second part could be trickier. Is it also possible to use the name token to move the file to a specific folder?
The parent folder would always be the same, it would be just another child folder, say instead of subfolder 'Supplier A' the subfolder 'Supplier B'.

Any thoughts and help highly appricated.

Best regards,
Thomas

Re: Import Name token content / Move to Name token

PostPosted: Mon Jul 20, 2020 10:08 am
by Mr_Noodle
You may be interested in the lists and tables support I'm adding to Hazel 5, due out later this year. That would allow you to create, in this case, a list of suppliers (or read it in from a file) to match against.

You can use the Sort into subfolder to move to a folder. That has a pattern where you can add custom attributes.

Re: Import Name token content / Move to Name token

PostPosted: Fri Jul 24, 2020 3:06 pm
by schmudi
Mr_Noodle wrote:You may be interested in the lists and tables support I'm adding to Hazel 5, due out later this year. That would allow you to create, in this case, a list of suppliers (or read it in from a file) to match against.

Yes, absolutely - that sounds very promising! Looking forward to it.

Mr_Noodle wrote:You can use the Sort into subfolder to move to a folder. That has a pattern where you can add custom attributes.

Great, that make life already now much easier. Thanks for the hint.