Using Retrobatch with Hazel, Apple Script errors

Hi.

I’m trying to use Retrobatch and Hazel together to automatically process images added to a folder (i dont want to use Folder Actions because Hazel is already doing tons of other stuff for me and the rules are being synced etc.)

This is the script Hazel is executing for every file:

set theName to theFile as string
tell application "Retrobatch"
    set d to open ((POSIX file "/Users/robert/Library/Mobile Documents/com~apple~CloudDocs/Helper/Sanitize.retrobatch") as alias)
    tell d
        execute input items theName
    end tell
    tell d
        quit
    end tell
end tell

This is the error i’m getting: (this totally could be Hazels fault, i don’t know, but since the error says something about “doesn’t understand the Exeecute (sic!) message” i’m asking here first)

2021-04-07 13:18:14.031 hazelworker[6588] IMG_1897.jpeg: Rule Retrobatch matched.
2021-04-07 13:18:14.393 hazelworker[6588] [Error] AppleScript failed: Error executing AppleScript on file /Users/robert/Desktop/Sanitize/IMG_1897.jpeg.
2021-04-07 13:18:14.393 hazelworker[6588] OSAScript error: {
    NSLocalizedDescription = "missing value doesn\U2019t understand the \U201c\U00abevent Exeecute\U00bb\U201d message.";
    NSLocalizedFailureReason = "missing value doesn\U2019t understand the \U201c\U00abevent Exeecute\U00bb\U201d message.";
    OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: null()>";
    OSAScriptErrorBriefMessageKey = "missing value doesn\U2019t understand the \U201c\U00abevent Exeecute\U00bb\U201d message.";
    OSAScriptErrorMessageKey = "missing value doesn\U2019t understand the \U201c\U00abevent Exeecute\U00bb\U201d message.";
    OSAScriptErrorNumberKey = "-1708";
    OSAScriptErrorOffendingObjectKey = "<NSAppleEventDescriptor: 'msng'>";
    OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}

Any ideas? Thanks!

I now switched to hazel running a shell-script similar to the one described here: Run Workflows in Background (headless)

Now everything works flawless. The question remains, but it’s not urgent :slight_smile:

Thanks!

I wonder if adding a "using terms from “Retrobatch” block in there would help it. The “Exeecute” command is part of Retrobatch’s suite.