Using shell script in embedded AppleScript

I'm trying to get SHA1 hashes from certain files. My embedded AppleScript is as follows:
But when I run it, it throws the following error:
Could really use some pointers.
- Code: Select all
set shasum to do shell script "/usr/bin/shasum -a1 " & theFile
set sha1 to text 1 thru 40 of shasum
return {hazelPassesScript:true, hazelOutputAttributes:sha1}
But when I run it, it throws the following error:
2020-09-07 23:47:48.959 hazelworker[11302] payments-noreply_google.com.pdf: Rule SHA1 matched.
2020-09-07 23:47:48.959 hazelworker[11302] DEBUG: Manual run. Forcing actions to be executed.
2020-09-07 23:47:49.133 hazelworker[11302] [Error] AppleScript failed: Error executing AppleScript on file /Volumes/sqooshdisk/88_hazel-test/payments-noreply_google.com.pdf.
2020-09-07 23:47:49.134 hazelworker[11302] OSAScript error: {
NSLocalizedDescription = "shasum: sqooshdisk:88_hazel-test:payments-noreply_google.com.pdf: ";
NSLocalizedFailureReason = "shasum: sqooshdisk:88_hazel-test:payments-noreply_google.com.pdf: ";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,2 \"hazelworker\"]>";
OSAScriptErrorAppNameKey = "Hazel.prefPane";
OSAScriptErrorBriefMessageKey = "shasum: sqooshdisk:88_hazel-test:payments-noreply_google.com.pdf: ";
OSAScriptErrorMessageKey = "shasum: sqooshdisk:88_hazel-test:payments-noreply_google.com.pdf: ";
OSAScriptErrorNumberKey = 1;
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
2020-09-07 23:47:49.134 hazelworker[11302] DEBUG: Tapping error retry sequence
2020-09-07 23:47:49.136 hazelworker[11302][PREDICTION] DEBUG: Calculating fire time - predicate: typeObject isType: "public.content" result: 0
2020-09-07 23:47:49.136 hazelworker[11302][PREDICTION] DEBUG: Next fire time: 4001-01-01 01:00:00.000
2020-09-07 23:47:49.136 hazelworker[11302][PREDICTION] DEBUG: Bail out: AND predicate
2020-09-07 23:47:49.137 hazelworker[11302][PREDICTION] DEBUG: Predicted fire time for file: /Volumes/sqooshdisk/88_hazel-test/tmp and rule SHA1: 4001-01-01 01:00:00.000 Should poll: 0
2020-09-07 23:47:49.137 hazelworker[11302] DEBUG: tmp: Did not match any rules.
2020-09-07 23:47:49.137 hazelworker[11302] DEBUG: Writing out DB file for /Volumes/sqooshdisk/88_hazel-test to path: /Users/sqoosh/Library/Application Support/Hazel/16777226-885965.hazeldb
Could really use some pointers.