Here's my applescript that returns a token that would be used by the next action to rename the file:
- Code: Select all
set whereFrom to "kMDItemWhereFroms"
set theMetadata to (do shell script "mdls -name kMDItemWhereFroms " & theFile)
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to whereFrom & " = ("
set theUrl to (text item 2 of theMetadata)
..a bunch of other parsing statements
set formattedDate to theYear & "-" & theMonth
return {hazelExportTokens:{statementDate:formattedDate}}
This is the only action for my rule. I get the following in the Console as a result:
2012-07-15 14:39:27.626 hazelworker[30279] AppleScript error: {
NSLocalizedDescription = "SSD:Users:David:Dropbox:Actions:statement.pdf: could not find SSD:Users:David:Dropbox:Actions:statement.pdf.";