Adding delay in AppleScript

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

Moderator: Mr_Noodle

Adding delay in AppleScript Fri Jun 10, 2022 4:58 pm • by kvora
Hello, I use Hazel to OCR PDFs using Nitro PDF Pro.
I used to use PDFpen Pro but ownership changed recently.
I scan documents using Scansnap, then they go to a monitored folder, where Hazel OCRs it with the following script, applies a tag and moves to a holding folder. The problem is, Scansnap gives me option to name the file, but things go so fast that before I can write the desired title, Hazel moves it to Nitro which starts OCR etc.
Here the script

tell application "Nitro PDF Pro"
open theFile as alias
tell document 1
ocr
repeat while performing ocr
delay 1
end repeat
delay 1
close with saving
end tell
quit
end tell


Is there a way to add delay in hazel rules or the script so I can title it before the train leave the station?
Thankk you
kvora
 
Posts: 15
Joined: Thu Jun 11, 2009 8:01 am

Re: Adding delay in AppleScript Mon Jun 13, 2022 8:51 am • by Mr_Noodle
It looks like the script already has delays. You could add extra delays as needed there.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support