Question - Passing Variables to AppleScript

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

Moderators: Mr_Noodle, Moderators

Question - Passing Variables to AppleScript Thu Feb 13, 2014 3:32 am • by Jon
I'm updating my Hazel Rules for storing paperless documents. In version 1, I wrote AppleScripts for each document to parse the values of Dates, Order#s, etc. Each of these scripts also changed the file dates to the date parsed from the file.

In version 2, I am replacing the parsing done with the AppleScripts with contents pattern matching. In the Tips & Tricks Forum, I saw the post about passing values by renaming the file to a string of the values and the AppleScript would retrieve the file name and parse the values.

The other morning, I had the idea of adding the values to the file as tags. At this time, I don't think AppleScript is able to retrieve tags. Using the XATTR and TOUCH commands in a shell script, I should be able to change the file dates.

Are there anything I should watch out for? Any thoughts or ideas?

Edited:
Jon
 
Posts: 9
Joined: Wed Feb 06, 2013 12:45 pm

I guess that's worth a try. Or you could try using the file's comments, which you can access via AppleScript.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion