Apple Script for OCRKit & Hazel Mojave OS

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
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