See Document on Scan whilst Smart Rules/Scripts are running

Last question for today:

for certain document types on scanning (and following automatic OCR to searchable PDF) a script will ask for certain details using a prompt. To be able to answer the questions/prompts, it would be useful to actually see the scanned document - is there any way I can tell the script to display the document (preferably in the DT preview window)? As the document doesn’t appear in the list view until after the smart rules have finished, it’s not obvious to me how to do that.

Are you referring to the Metadata panel?
If so, no it’s not scriptable.

No, I only want the document to become selected so that I can see which document the smart rule is referring to, and for the document to preferably be displayed in preview.

So, I scan a document, SSH sends it to DT.
DT is set to OCR in the preferences.
A smart rule triggers after OCR and with a script asks “what colour is the document”

  • and I can’t answer, because the document is not displayed anywhere at this point.

Is that a better explanation of what I’m trying to do?

Smart rules are made to run headlessly, with no user intevention.
Also, processing a selection is not the intention of smart rules.

What are you specifically trying to get an answer to and how is it supposed to affect the selection?

Put simply: certain documents have a handwritten number on them; on scanning, I’m asking the user to enter that number (which is then pasted to custom metadata).

The selection isn’t to be influenced by the input - what I need is to be able to read the document when I enter the number - ie for the document to show in the preview window (as if it were selected). Currently that doesn’t happen, because rules triggered on import after automatic OCR act on the document before it becomes visible.

There’s the action “Open externally” in smart rules. It might be not as elegant as you intend it to be, but at least you could see the document.

But since there doesn’t seem to be a way to ask for user input in a smart rule except for using a script, you could do all that in that script anyway:

  • Display the document in Preview (tell application “Preview” …)
  • open a dialog asking the user for input (i.e. the number)
  • move the number to meta data
1 Like

yes Sir, I can - in a little window in the corner of the screen, one which closes again when I have entered the requisite data. Preview is not very scriptable, but it should suffice :slight_smile: