"External variables" for tokens

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

"External variables" for tokens Thu Apr 21, 2016 1:23 pm • by Tätä
Hello,

I use in several Hazel rules the possibility to execute an AppleScript. I find it very comfortable to chose an "external“ AppleScript. So, if I have to change something, it's enough to change only the external AppleScript once.

It's possible to to transfer this modus operandi to other tokens like the "Contents > contain match“-Token?

Example: When I have different bank account cards, one for business and one for private, then the scanned receipts show either the card number like „XXXXX0972" for business or „XXXX7990“ for private. Now I can match the content respectively the end of the number for rename, move and tagging the .pdf in different way (private vs. business). So far so good, but the card number change every 3 years when I receive a new card. I have about 50-60 rules with such match-token that I have to change respectively adapt in certain cases, and it’s a little bit a nightmare when I have to change all these tokens by hand…

I suggest that the problem could be solved with Applescript, but I’am not saddle-fast in AppleScript.
Tätä
 
Posts: 7
Joined: Fri Mar 04, 2016 6:45 am

Re: "External variables" for tokens Fri Apr 22, 2016 9:05 am • by Mr_Noodle
Search the help for AppleScript. You can return a record and one of the things you can return is values for custom attributes. You then specify in Hazel what those attributes are and you can then use them from that point onwards.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: "External variables" for tokens Mon Apr 25, 2016 6:18 am • by Tätä
Thank you!

I will get trough this in the next weeks. When I have questions, I will post them in the forum.
Tätä
 
Posts: 7
Joined: Fri Mar 04, 2016 6:45 am


Return to Support