Rule based on path


I would like to do some pre-filtering with my scanner and so I have the following folder structure:

scan/invoice/ paid

Now I have the problem how to realize this with a smart rule, so that it reads the path, unfortunately I can’t find a suitable solution, would this be possible?

The input I have of course also solved so that this is displayed correctly but also by Unterodner in the input it is not possible.

I would like a rule which sets me at path “paid” the tag “paid” and so on.

The only possibility I have in mind is to make a separate rule for each folder, which seems a bit unpractical to me.

Thanks a lot

If I understand you correctly (and that’s a big If):

  • You have a folder somewhere (a NAS? your Mac?) south too subfolders
  • By some magic, your scanner puts scans in one of these two folders (what kind of magic is that?)
  • you are looking for a smart rule that adds tags to files in these subfolders depending on their names

For that to be possible at all, you’d have to index these folders in DT. Are you? If so, the easiest solution I can think of would be to two smart rules, one for each folder. Problem solved. Others might have better ideas.

Personally, I’d try to use the magic of your scan process to assign the tags. Or rethink the whole setup.

My workflow looks like this:

I have created several QuickButtons on my scanner which place the files on the SMB location I have specified.

This in turn triggers an rsync command which copies the files to the local filesystem. (SMB with Devonthink caused me only problems, therefore this step).

Here again DevonThink accesses the folder structure, indexes it.

Now I have not only two folders as named in my example about 7, per person. I would find it easier to index the files already during scanning, especially with invoices, this makes a lot of sense in my eyes.

Of course I can create a separate rule for each folder, but it would be much more ingenious that the path is also read out I mean the data should DevonThink but zur verfüfung are?

Or could I do something with a script here?

I’m also not clear on what you’re attempting to accomplish.

If you just want items in the paid group to have a paid tag, add the tag to the paid group and enable File > Database Properties > Inherit Tags of Groups for the database.


So you have several “persons” and seven folders per person? In that case, I’d

  • scan to a single folder, possibly with OCR
  • Use a script
    • to analyze the text, and
    • process it accordingly (move, set tags etc)

I posted a sample script here ages ago. You should be able to find it when you search for “replace hazel maybe”.

Brilliant, thank you!

As I said, I already do some pre-filtering when scanning. So I have already tagged a lot of things correctly.

Or do I make something more complicated than it is? I am gladly open to other suggestions

For me it fits so with the solution as mentioned above, I have now tagged the folders accordingly (I did not know that this is possible)

so the further processing is much easier.

Invoices which are paid are enriched only with metadata and referenced in the defined smart folders.

Glad to teach you something! :slight_smile:
It sounds like you have things working as you’d like now.

1 Like