Trigger "Enter Metadata Window" using Smart Rule

Is there any way to trigger the Metadata Input Window (the one which opens automatically following OCR if set up that way in preferences) using a smart rule? If not, pls may I request such a rule? Pls :slight_smile:

The request is noted but why do you want this?

Well, as a rule it’s better to have something that to need it :smiley:

But more to the point, I’d like to implement the following workflow:

OCR document from “Henry’s little lamb insurance company”; I have a smart rule on import to rename any document from said insurance to “HLLIC - Insurance Document”, change the created date to the document date and put the document in the subgroup “HLLIC” in my group “insurance”.

Same for other documents so specific that they can be automatically renamed and filed.

Those documents which are not covered by a specific smart rule should (by triggering the last smart rule in the list) automatically open the enter metadata window so that I can manually name them and assign a creation date.

Currently I have DT set up to always open the metadata entry window - for those documents with smart rules that is unnecessary though. If I turn off automatic metadata window I have to specifically select those documents remaining in the inbox after scanning, open the inspector…

So, basically, just to further automise my workflow.

Ideally smart rules are faceless and don’t require any user interaction so that they can be performed in the background.

I agree; due to the fact that I am forced to produce hand-written documents in the field though, I have files which will never be completely amenable to smart rules and instead require some input. Already those files are recognised and filed by smart rules, but I have to produce the file name and date manually. To be able to trigger DT to ask for that data would be very helpful to me personally (and that’s all this thread is - a request from me for something which would be useful to me - as with all requests I fully recognise that it is for DT to prioritise and accept or decline wishes; but a wish not voiced is one that certainly won’t be fulfilled).

Basically this would be the last smart rule on the list - i.e. if all previous rules haven’t successfully dealt with the document this last rule would ask for further input.

If you’re just entering a name, you could use an Execute Script action and call display dialog or display name editor.

Here is a very simple example…

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theRecord in theRecords
			set newName to display name editor
			set name of theRecord to newName
		end repeat
	end tell
end performSmartRule

Rename - Blanc.dtSmartRule.zip (1.4 KB)

Thanks Jim - even that simple little script is beyond my capabilities (I’ve just watched a bloke on YouTube wood turning, can’t do that either), so I’m really grateful you didn’t just suggest “use scripting”. I usually need to enter the “created” date as well as the file name. The other thing is, if I understand the script correctly, I won’t see the file anywhere? I use the preview window after scanning to see what I have written on the document before assigning a name.

However, I will play with what you have provided and see what happens :slight_smile: thanks again :hugs:

Keeping things simple, you can enter whatever you’d like in the name editor (though you should always be wary of punctuation other than hpyhens, underscores, periods, and spaces). So 20200102_Big Tax Bill is acceptable.


You can set the event trigger to On Demand then select a file and use Tools > Apply Rules > … to run the smart rule on the selected files.

Also, if you select more than one file, the version of the script below will cache the first thing you entered, so you could add 20200302_file 1 and the next appearance of the name editor would keep this as the default answer. That way, if you wanted to reuse the date, you’d just need to change the file 1 to something else…

property newName : ""

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theRecord in theRecords
			set newName to display name editor default answer "" & newName
			set name of theRecord to newName
		end repeat
	end tell
end performSmartRule

(Note: the cached value will not persist after quitting and relaunching DEVONthink.)

rename-blanc


PS: Wood turning is awesome! :heart: A bit scary sometimes but very satisfying. :slight_smile:

Thanks again for that; too simple, I think. I have several thousand documents which don’t adhere to that naming convention, so would have to put a lot of effort into changing my current system. The advantage of having a file name which is separate from the date is that I can later sort based on one or the other, as required. That is especially relevant for those documents which cannot be content-searched (hand-written). In addition, data protection laws require me to delete some files when they are a certain number of years old - I have a smart rule which can provide me the relevant information on a day for day basis based on the creation date. Whilst a rule could certainly filter “2020” in the filename it could not reasonably also filter for month and day (without oodles of rules, anyway) and would find (and risk me deleting) any filenames which contained “2020” for other reasons.

Whilst I will easily wiggle my way through, for my purposes at least, I think the ability to trigger the metadata input window would be most helpful; that may be because my brain just works that way :smiley: now, has anybody got a lathe?

Yes, a Jet 1642! :grin:

1 Like

data protection laws require me to delete some files when they are a certain number of years old

It would be possible to add a Reminder to such files an use an Execute Script action to delete the file.

Amazing - all roads lead to Rome