Multiple hazelExportTokens

I'm trying to export two custom tokens from an external Applescript called by a Hazel rule, but there seems to be a bug here.
Basically, I'm trying to write a rule that automatically encrypts a PDF using a password that changes depending on the name of the file. My Applescript routine parses the filename (passed by Hazel), constructs the password and creates a new filename (basically adding '-p' at the end to signify that it's password-protected).
Now the Applescript runs fine and creates both the custom password and the new filename. However, when I try to export both, only 1 gets exported (I'm testing this via a call to a Growl notification in Hazel after my Applescript runs). I've defined two custom tokens in Hazel to match the two return values, called newpassword and newPDFName and the Growl notification uses both these tokens.
The Growl notification format is "newpassword - newPDFName"
If I use:
(so the Applescript is working just fine; and, of course, the other token ain't there so Growl shows only 1 token)
Now, here's the strange part:
If I use:
If I use:
So, it seems that only one (the first) value is being passed through both tokens.
What gives? Any help appreciated!
(BTW, once the above starts working I plan to call a shell script with pdfauxinfo [url]msyk.net/macos/pdfauxinfo/[/url] to set the password on the PDF - I've used that in a stand-alone Applescript and it works peachy!)
Basically, I'm trying to write a rule that automatically encrypts a PDF using a password that changes depending on the name of the file. My Applescript routine parses the filename (passed by Hazel), constructs the password and creates a new filename (basically adding '-p' at the end to signify that it's password-protected).
Now the Applescript runs fine and creates both the custom password and the new filename. However, when I try to export both, only 1 gets exported (I'm testing this via a call to a Growl notification in Hazel after my Applescript runs). I've defined two custom tokens in Hazel to match the two return values, called newpassword and newPDFName and the Growl notification uses both these tokens.
The Growl notification format is "newpassword - newPDFName"
If I use:
- Code: Select all
return {hazelExportTokens:{newpassword:newpassword}}
- Code: Select all
return {hazelExportTokens:{newPDFName:newPDFName}}
(so the Applescript is working just fine; and, of course, the other token ain't there so Growl shows only 1 token)
Now, here's the strange part:
If I use:
- Code: Select all
return {hazelExportTokens:{newpassword:newpassword, newPDFName:newPDFName}}
If I use:
- Code: Select all
return {hazelExportTokens:{newPDFName:newPDFName, newpassword:newpassword}}
So, it seems that only one (the first) value is being passed through both tokens.
What gives? Any help appreciated!
(BTW, once the above starts working I plan to call a shell script with pdfauxinfo [url]msyk.net/macos/pdfauxinfo/[/url] to set the password on the PDF - I've used that in a stand-alone Applescript and it works peachy!)