Pattern matching variables and Applescript

Hi,
I've got a problem trying to extract dates from filenames that is driving me slightly crazy. I have a bunch of document scans that have filenames that look like "Adobe - 10-10-13.pdf" or "CSAA - 10-21-13 54.pdf". The actual date of the document (extracted by OCR) is the mon-day-year format.
I have a simple date extraction rule that extracts the date from the filename to a variable called matchedDate. This does work as I can see the date showing up in matchedDate in the examine dialog for each file (and the correct rule is being matched). So I know the rule is working.
However, when I attempt to run a (very) simple Applescript, I get a stack overflow error.
2015-06-29 11:24:19.923 hazelworker[819] [Error] AppleScript failed: Error executing AppleScript on file /Users/smackie/Documents/Evernote/Set Creation Date/CSAA - 10-21-13 1.pdf.
2015-06-29 11:24:19.924 hazelworker[819] OSAScript error: {
NSLocalizedDescription = "Stack overflow.";
NSLocalizedFailureReason = "Stack overflow.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: null()>";
OSAScriptErrorBriefMessageKey = "Stack overflow.";
OSAScriptErrorMessageKey = "Stack overflow.";
OSAScriptErrorNumberKey = "-2706";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
The only input attribute I'm passing to the script is the matchedDate custom variable. I'm sure this is something simple that I'm doing wrong but I can't see it. The Applescript looks like
on hazelProcessFile(theFile, inputAttributes)
tell "Finder"
set creation date of theFile to item 1 of inputAttributes
end tell
end hazelProcessFile
It doesn't matter whether the script is embedded or external in a file (with the full wrapping above). I still see stack overflows. The gotcha is that it *has* worked occasionally.
I'm running OS X 10.10.3 and Hazel 3.3.5
Any clues?
Scott...
I've got a problem trying to extract dates from filenames that is driving me slightly crazy. I have a bunch of document scans that have filenames that look like "Adobe - 10-10-13.pdf" or "CSAA - 10-21-13 54.pdf". The actual date of the document (extracted by OCR) is the mon-day-year format.
I have a simple date extraction rule that extracts the date from the filename to a variable called matchedDate. This does work as I can see the date showing up in matchedDate in the examine dialog for each file (and the correct rule is being matched). So I know the rule is working.
However, when I attempt to run a (very) simple Applescript, I get a stack overflow error.
2015-06-29 11:24:19.923 hazelworker[819] [Error] AppleScript failed: Error executing AppleScript on file /Users/smackie/Documents/Evernote/Set Creation Date/CSAA - 10-21-13 1.pdf.
2015-06-29 11:24:19.924 hazelworker[819] OSAScript error: {
NSLocalizedDescription = "Stack overflow.";
NSLocalizedFailureReason = "Stack overflow.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: null()>";
OSAScriptErrorBriefMessageKey = "Stack overflow.";
OSAScriptErrorMessageKey = "Stack overflow.";
OSAScriptErrorNumberKey = "-2706";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
The only input attribute I'm passing to the script is the matchedDate custom variable. I'm sure this is something simple that I'm doing wrong but I can't see it. The Applescript looks like
on hazelProcessFile(theFile, inputAttributes)
tell "Finder"
set creation date of theFile to item 1 of inputAttributes
end tell
end hazelProcessFile
It doesn't matter whether the script is embedded or external in a file (with the full wrapping above). I still see stack overflows. The gotcha is that it *has* worked occasionally.
I'm running OS X 10.10.3 and Hazel 3.3.5
Any clues?
Scott...