Passing a Hardcoded Text value from Hazel to a Script

Hope you can help me out.
Is there a was to set a variable/token to a set Value which then can be used as an input variable into a script which is run without matching?
Context:
I have a generic applescript that accepts 8 variables from Hazel. These variables are then manipulated within the script which then returns a text value for Hazel to use later on.
Example of the script: (Please note this is a stripped down version of the logic for purposes of this thread.)
In the code above I would like Hazel to pass through the Value of "CONS" to item 4 of inputAttributes. However this value of "CONS" is not extracted as a match on any content/name etc.
I would Simply like to set/hardcode the value of "CONS" into the inputAttribute of the script. (Note the reason why I dont hard code this in the script is that some rules will pass in different values eg "TRVL"
I have tried to create a Dummy Varable that "Does Not match a Textual Value eg
"Extension" "do not match" *AccountCode
where *AccountCode is Trying to match on the Value "CONS"
This passes (as the file is a PDF an there is no match on the extension being CONS)
I then Pass this variable (*AccountCode) into the AppleScript above in item 4 of inputAttributes from Hazel.
However it unfortunately passes "missing value" into item 4
Is there anyway of setting a hardcoded text string to the variable?
Theo
Is there a was to set a variable/token to a set Value which then can be used as an input variable into a script which is run without matching?
Context:
I have a generic applescript that accepts 8 variables from Hazel. These variables are then manipulated within the script which then returns a text value for Hazel to use later on.
Example of the script: (Please note this is a stripped down version of the logic for purposes of this thread.)
- Code: Select all
on hazelMatchFile(theFile, inputAttributes)
set textCompanyName to item 1 of inputAttributes
set dateReceiptDate to item 2 of inputAttributes
set textVenueCode to item 3 of inputAttributes
set textAccountCode to item 4 of inputAttributes
set textTaxType to item 5 of inputAttributes
set textInvoiceTotal to item 6 of inputAttributes
set textCurrency to item 7 of inputAttributes
set textInvoiceNumber to item 8 of inputAttributes
-- Reformat Date to YYYYMMDD
set yReceiptDate to text -4 thru -1 of ("0000" & (year of dateReceiptDate))
set mReceiptDate to text -2 thru -1 of ("00" & ((month of dateReceiptDate) as integer))
set dReceiptDate to text -2 thru -1 of ("00" & (day of dateReceiptDate))
set textReceiptDate to yReceiptDate & mReceiptDate & dReceiptDate
-- Concatenate File Name
set newFilename to textCompanyName & " - " & textReceiptDate & " - " & textVenueCode & " - " & textAccountCode & " - " & textCurrency & " - " & "Inv " & textInvoiceNumber & ".pdf"
-- Return Values to Script
return {hazelPassesScript:true, hazelOutputAttributes:{newFilename}}
end hazelMatchFile
In the code above I would like Hazel to pass through the Value of "CONS" to item 4 of inputAttributes. However this value of "CONS" is not extracted as a match on any content/name etc.
I would Simply like to set/hardcode the value of "CONS" into the inputAttribute of the script. (Note the reason why I dont hard code this in the script is that some rules will pass in different values eg "TRVL"
I have tried to create a Dummy Varable that "Does Not match a Textual Value eg
"Extension" "do not match" *AccountCode
where *AccountCode is Trying to match on the Value "CONS"
This passes (as the file is a PDF an there is no match on the extension being CONS)
I then Pass this variable (*AccountCode) into the AppleScript above in item 4 of inputAttributes from Hazel.
However it unfortunately passes "missing value" into item 4
Is there anyway of setting a hardcoded text string to the variable?
Theo