Problems with custom date tokens

I've been playing around with using custom date tokens and extracting exif data from photos. So far, I've been able to successfully extract the photo's capture time and return it as an hazelOutputAttribute using JavaScript in an external script
I'm running into two issues:
1. Hazel doesn't seem to save the custom attributes when re-opening the rule. This means that each time I re-open the script, I have to remove all uses of the custom attribute token, re-add it in the Options pane, and then re-add them where I used them previously.
2. Edit Date Pattern doesn't seem to respect what I put in for hour, minute and seconds.
An example:
YY-mm-dd HHxMMxSS

Tailing the Hazel logs, I get this
No matter what separator I use for the HH:MM:SS, including no separator at all, I still get colons.
Thanks!
- Code: Select all
function hazelMatchFile(theFile, inputAttributes)
{
var app = Application.currentApplication();
app.includeStandardAdditions = true;
var checkDate = app.doShellScript("exiftool -s3 -DateTimeOriginal '" + theFile + "'");
if (checkDate == ""){
return false
}
date = checkDate.slice(0,10).replace(/:/g, '/')
hours = checkDate.split(' ')[1]
outputDate = new Date(date + ' ' + hours)
obj = {
hazelOutputAttributes: [outputDate],
hazelPassesScript: true
}
return obj
}
I'm running into two issues:
1. Hazel doesn't seem to save the custom attributes when re-opening the rule. This means that each time I re-open the script, I have to remove all uses of the custom attribute token, re-add it in the Options pane, and then re-add them where I used them previously.
2. Edit Date Pattern doesn't seem to respect what I put in for hour, minute and seconds.
An example:
YY-mm-dd HHxMMxSS

Tailing the Hazel logs, I get this
- Code: Select all
2015-02-15 11:17:02.092 hazelworker[35303] [Custom Message] Hazel Alert: 15-02-15 22:49:03
No matter what separator I use for the HH:MM:SS, including no separator at all, I still get colons.
Thanks!