Copy path to group for use in "File"-action

Hi there,

I just started building Smart Actions to move files (PDFs) from the global Inbox to a subgroup.

Source: Global Inbox (for the smart action)
Move: Other DB
File: /Finance/Vendor XY/Receipts/<Year>

I found several good blog posts on the internet explaining the use of the Move + File-actions to make this possible, but no good information about how to get the path location of a group in a non-picture scenario.

Currently my structure is a bit more nested as the example given above. To prevent any typos I looked for a way to copy & paste the path location of the subgroup in the File-action. In some later iteration I want to replace the static vendor with a variable.

How can I copy the location of a target group which is required for the File-action? I don’t want to write it down by hand. This feels a bit cumbersome.

I’m happy to get some links to other posts I oversaw during my research.

Thanks a lot.

For now I solved the problem with a deep move and a relative file. But I’m still interested if there’s a way to copy the location of a group.


Welcome @MarvinMarvelouis

how to get the path location of a group

The File action doesn’t create subgroups in a location you’ve moved to. This is discussed in this blog post…

So enter the full location you want to file to. The Move action in this case is to just move the document to another database.

in a non-picture scenario.

Please clarify what this means.

Hi @BLUEFROG. Thanks a lot pointing me to the blog post above. This was quite helpful.

Move and File

The File action doesn’t create subgroups in a location you’ve moved to. This is discussed in this blog post…

I’m not sure if we talk about the same.

Given this rule:

And this group structure + file:

When I apply the rule, the move + file-actions work as wanted:

Is there anything I miss. My solution seems to “work” as expected from my side.

Copy location of group111

On the next iteration I would love to rebuild the smart rules to be more dynamic. Something similar to this smart rule:


There might be some steps inbetween which are less “dynamic” without any placeholder. I just started to get comfortable with DEVONthink and don’t want to make things too complicated at the beginning. Those steps in between might require a rule per company.

I need to build rules and write down full locations manually which I want to avoid. That’s the reason why I asked where I can copy the full location of a subgroup.

Something similar to that:

Plan B

  1. Given the deeply move-action above + plus the dynamic creation of a subgroup makes less error prone. For now I have a solution for my problem.
  2. Or I just create a template rule which I duplicate for each company. This would also reduce the risk of making typos.

I hope my explanations make it more clear, what I want to achieve. Thanks a lot for your help.

Or you use a script that does what your smart rule does, depending on the company. For me, that is preferable to a heap of smart rules. YMMV, of course.

@chrillek You mean an Apple-Script script?

Do you have any recommendation for a good book about Apple Script oder a website? Have never used it before.

That was a good one. I’m probably the most non-AppleScript person in this forum you can find. I use JavaScript unless someone holds a gun to my head :wink:

But right now, I’m a bit lost. Your post started out in the DEVONagent sub-forum, but the screenshots looked so much like DEVONthink ones that I thought we’re now talking about that. If we are: Yes, a JavaScript script would be what I’d use. And I’d, of course, suggest heading to Scripting with JXA | JavaScript for Automation (JXA) for more information (since that’s me talking there).

If we’re still talking about DEVONagent, my advice might be completely off, so please ignore it.

See? 11.5 years in and I still learn things as situations arise…

The File smart rule action can create both relative and absolute locations.
The default behavior is to create an absolute path.

While you’d still use a Move action to move an item between databases…

This creates an absolute path. Note the prefixing /

This creates a relative path. Note the lack of a preceding /

(And post moved to DEVONthink > Automation)

1 Like

Yes, I mixed things up with the wrong subform. I saw it, but couldn’t see a way to fix it. Sorry for the confusion.

Sometimes I feel old, when situations arise where the UI does not fit my needs. :wink:

Thanks for sharing the link.