Smart Rule for Text

Sorry if this is a completely stupid question, but I can’t seem to figure out how to create a smart rule that moves a file based on its text contents. For example, I’ve got some meeting notes I took in plain text and imported into my Inbox.

I’d like a smart rule to act on the “meeting notes” somewhere in that plain text, move the document to a specific folder, then run a script to send the item to my OmniFocus inbox for later processing.

I’ve tried the “Contents” dropdown option, but it only shows “matches” as an option instead of “contains” – does that matter? Or am I missing something even more obvious?

Here’s a screenshot:

Thank you!

The Content matches would determine if you see a matched file in the targeted location.
If you do, you have the event trigger set to On Demand. That essentailly runs a rule when you Control-click it and choose Apple Rule.

And where did the plain text file originate?

Oh, I see. This file is just in my inbox of the given database. I take notes on various platforms because I like the flexibility, but eventually I send them to my DT inbox for processing and archival.

I basically just want the smart rule to look at every file that touches my inbox, check to see if it has readable text, and if it does check for the “meeting notes” text anywhere in the file, then move it to a certain group inside the DT database if it does, and send a link to the DT version to my OmniFocus inbox.

Do I just need to choose something other than “Content” in the dropdown?

I basically just want the smart rule to look at every file that touches my inbox

I would not suggest that unless you are routinely keeping your Inbox cleaned out, or being very fastidious in your creation and importing of data.

Generally speaking you should be specific in your targeting and criteria to control the process.

If it’s plain text, add a Kind is Plain Text.
If it has content required, add Content matches ….
You could add items like Date Created is This Week.

Specific = more controllable effects and processes.

And you’d also want to use the On Import event trigger if you’re wanting to process the files when you drop them in the Global Inbox.

Great advice, thank you!

I’m still not sure I understand how to tell the rule to look inside a .txt file and perform an action if it finds “meeting notes” anywhere in the text… Sorry, did I miss something?

I’ll be sure to be very specific too to keep things manageable :slight_smile:

You have the trigger set to “On Demand”, so the rule only runs when you activate it with a mouse click.

If you want to automate that part, change that the trigger to something else like “On Import”.

In essence every automation requires an initial energy input, i.e. some “kick-off” event that changes a situation. Whether that is a progressing clock, a mouse click, you changing a file or importing a document etc.

Ah, that makes sense, thank you!

And which of these options do I choose to have DT search the text of the given file?

Content - text.

Right, that narrows it down to a text file. But which option do I use to tell DT to search inside that text file and do something if there’s a matching text string?

That is the option. If you put Content matches XYZ, it’s looking for items with XYZ in the text of the document.

Ah I see, sorry. Thank you!

No worries :blush: