How to add lots of conditions to a Smart Rule?

Hi all (and a special tip of the hat to you Jim)

I need to create a few smart rules that look at whether an item’s tag is in a list of items (the “IN” thing in databases, programming, etc) - and I suspect I can’t do that in DevonThink.

I can do a clause “Tag is” then start typing tags and select them from the ensuing pop-up, but it is way too many.

Any ideas, hacks, etc? Can I access the smart rule code and do it manually (copy & paste) from, say, BBEdit?

tx!!

Howdy, howdy :cowboy_hat_face:

  • What is your list of items?
  • Why can’t you just add a Tag is ______ criterion? I’m not clear on the details of the automation.

oops sorry Jim - when you don’t understand it means I REALLY am being thick :slight_smile:
So, the rule would be something like this:

If tag is “A”
If tag is “B”

if tag is “Z”

then

add tag “letters of the alphabet”

things is, doing the 'if tag" [A][B]…[C] is very tedious, it’s far more than 20-30 values…

I tried pasting a string “A,B,C…Z” inside the value field, but it just creates a monster mega-blue-tag-like thing ha ha

Mike

Good try but indeed that would not work.

This would require some scripting.

  1. Where is your list of tags?
  2. In your example, “If tag is ‘A’”, etc., is that to illustrate processing multiple files?
  3. If just one of the tags match, does it get the “letters of the alphabet” tag?
  4. Why do you have so many tags to consider?

yeah, the old trick of using separators :wink:
BTW, I meant the “IN” as in the SQL “value is in { }”

These are regular DT file tags, I use them a lot, shallowly. E.g., “Flower”, “Stem”.
But also, “Section”, “Family”, “Etzold” and so on (some are systematics terms, other are microscopy terms, others are technique, people, etc)

Because I have maybe 100k items, and I haven’t been a good boy tagging from the (remote) beginning, I wanted to go back and add a tag “Botany” to all items that have at least one of these tags - of which there are dozens.

Now that also applies to another big section of my files, “Arthropoda”. And then there is “Protista”

yep.

So pseudocode:

Look at every item in the database
Does it have at least one of the tags in { }
If so, add tag “Botany”

So I was trying to construct something as a set, rather than a very large number of ORs

is it a bit clearer?

Mike

And, Jim, I believe it has to be done this way, because inside my group hierarchy, there are sometimes groups and items that don’t (and shouldn’t) have any of these special tags, so en masse dragging groups over the tag “Botany” won’t work.

Ha ha ha I figured it out!

Not a comma, but a semicolon!!

Well, it WAS built by real programmers eh!

/mike

the string:

the resulting smart rule:

And this is the kind of stuff I was tagging… (and avoiding the use of hierarchical tags, which I also avoid in Lightroom because they always end up breaking)

:slight_smile:
I don’t know if there’d be any resource penalty for having so many criteria but I’m glad you got somewhere with it.

1 Like