AppleScript error -36 when rule is run

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

AppleScript error -36 when rule is run Fri Mar 15, 2024 11:26 am • by dombett
I have a rule that has been working for a long time, but has broken after switching to a new computer. Now when it runs I get an AppleScript error -36.

Hazel is watching a Dropbox folder and when a matching text file appears, it runs an embedded AppleScript that launches a Keyboard Maestro macro to use the contents of the text file to make a new Omnifocus project.

Here is the error in the log:
Code: Select all
2024-03-15 11:13:20.521 hazelworker[25881] WHO372.txt: Rule New SDW Project matched.
2024-03-15 11:13:20.521 hazelworker[25881] Hazel Alert: WHO372.txt has arrived. HANDS OFF!
2024-03-15 11:13:20.521 hazelworker[25881] [Custom Message] Hazel Alert: WHO372.txt has arrived. HANDS OFF!
2024-03-15 11:13:20.609 hazelworker[25881] [Error] AppleScript failed: Error executing AppleScript on file /Users/domenicobettinelli/Library/CloudStorage/Dropbox/OF Projects/WHO372.txt.
2024-03-15 11:13:20.609 hazelworker[25881] OSAScript error: {
    NSLocalizedDescription = "An error of type -36 has occurred.";
    NSLocalizedFailureReason = "An error of type -36 has occurred.";
    OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,2 \"hazelworker\"]>";
    OSAScriptErrorAppNameKey = hazelworker;
    OSAScriptErrorBriefMessageKey = "An error of type -36 has occurred.";
    OSAScriptErrorMessageKey = "An error of type -36 has occurred.";
    OSAScriptErrorNumberKey = "-36";
    OSAScriptErrorOffendingObjectKey = "<NSAppleEventDescriptor: \"file:///Users/domenicobettinelli/Library/CloudStorage/Dropbox/OF%20Projects/WHO372.txt\">";
    OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}


Here is the script:

Code: Select all
set file_content to (read theFile)
set the clipboard to file_content

tell application "Keyboard Maestro Engine"
   do script "5A738B73-1E68-440B-8905-5B42AB94DA52"
end tell


Here is the rule:
Image

But if I run the script manually in Script Editor, in addition to the manually run AppleScript running as it should, the Hazel rule also runs as it's supposed to be, and I get two projects in Omnifocus instead of one.

Any ideas? Thanks!
dombett
 
Posts: 2
Joined: Tue Jan 07, 2020 10:04 am

Re: AppleScript error -36 when rule is run Mon Mar 18, 2024 8:31 am • by Mr_Noodle
You already emailed about this. Please continue with the discussion there.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron