Ive just discovered Hazel and think its amazing. Please forgive me, but I am very new to both Hazel and Apple script and am trying to write a very simple script (external) that returns a value (File Name) back to Hazel to be used later on when renaming the file. In this instance "New Filename.pdf. See eg code below.
- Code: Select all
on hazelMatchFile(theFile, inputAttributes)
return {hazelOutputAttributes:{"New Filename.pdf"}}
end hazelMatchFile
However this simple script throws an exception
Invalid AppleScript return value: <NSAppleEventDescriptor: { 'usrf':[ 'utxt'("hazelOutputAttributes"), [ 'utxt'("New Filename.pdf") ] ] }>.
I was wondering if there is a simple example of an external Applescript returning values which I can reference? Ive tried searching the forum to no avail.