Apple Script for OCRKit & Hazel Mojave OS

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

Moderator: Mr_Noodle

Apple Script for OCRKit & Hazel Mojave OS Mon Oct 22, 2018 1:58 pm • by Moped
Hello, there,
do you have an Apple script for OCRKit Pro that is compatible with Hazel?
With this script the error always appears after "repeat while performing ocr".
ocr is not executed with the message "End of line expected but identifier found".
Hazel then gives an error message: [Error] AppleScript failed: Error executing - The variable ocr is not defined."
Here is the script:
tell application "OCRKit Pro"
open theFile as alias
tell document 1
ocr
repeat while performing ocr
Delay 1
end repeat
Delay 1
close with saving
end tell
tell application "OCRKit Pro"
quit
end tell
end tell

I would be very grateful about a short info
Greeting Moped
Moped
 
Posts: 2
Joined: Mon Oct 22, 2018 1:55 pm

Re: Apple Script for OCRKit & Hazel Mojave OS Tue Oct 23, 2018 10:58 am • by Mr_Noodle
Have you tried the script outside of Hazel? Does it work there?

Also, try formatting your script within code tags to make them more readable.
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Apple Script for OCRKit & Hazel Mojave OS Tue Oct 23, 2018 12:43 pm • by Moped
Hello,
it also shows the error message in the Automator:
End of line expected, but identifier found.

How can I rewrite or add to the script to make it work?

Greetings Moped
Moped
 
Posts: 2
Joined: Mon Oct 22, 2018 1:55 pm

Re: Apple Script for OCRKit & Hazel Mojave OS Wed Oct 24, 2018 10:47 am • by Mr_Noodle
Contact the dev of OCRKit Pro as it doesn't seem to be anything related to Hazel.
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support