How to use placeholders for/within smart rules?

Hi everyone,

I am still quite new to using DEVONthink but already tried - with not much luck - to find more information on how to use placeholders within smart rules to rename files.

I’d like to rename a file by just adding the creation date of the file to the name of the file, like:

currentFileName.pdf to creationDate_currentFileName.pdf

DEVONthink seems to use %recordName% as a placeholder for “currentFileName”.

As DEVONthink doesn’t not seem to preview available placeholders while entering e.g. %creationDate% into the form I tried to google placeholders that are available for use in smart rules.

In the manual I couldn’t find a placeholder that is used for the fileCreationDate, which is why I googled and came across %creationDate% and/or “documentDate”.

But when I enter for example %creationDate%_%recordName% it does seem to work for the form but the output is still incorrect (when I apply the rule afterwards).

File name: XYZ.pdf

After the rule is applied the file name is changed to %creationDate%_XYZ.pdf. The first placeholder isn’t recognized/replaced by DEVONthink. I would expect that the file would be renamed like 190831_XYZ.pdf

What am I doing wrong? Is there anywhere a support article on how to use this functionality in detail?

Is there a setting to activate an autocomplete option for these placeholders so that one can see while entering e.g. date which placeholders with …date… are available?

Hope someone can lead me into the right direction. Thank you! :blush:

Are you typing in the percent form instead of using the actual placeholders?

Placeholders are covered in Help > Documentation > Appendix > Placeholders.

This is working as expected here:

Hi Jim,

thanks for your input. Yes that’s what I tried.

I entered %creationDate%:

34

After entering %creationDate% I hit enter to have it highlighted in blue:
59

Then I added the rest _%recordName% and applied the rule.

The output does still look like this:
14

I am running DEVONthink 3 (latest beta) on macOS 10.14.6 (18G87). Don’t know what is going wrong here (maybe I still do something wrong).

Thanks,
Lukas

The creation date you manually typed into the will not work this way.
Control-click in the text field and choose Insert > Placeholder > Creation Date and the formatting option you want to use.

1 Like

Thank you very much, now it works!

And I was now also able to adjust the formatting from %recordCreationShortDate% (currently looking like this DD.MM.YYYY) to this YYMMDD by using the macOS system preferences.

But do you know whether the formatting of %recordCreationShortDate% can be adjusted within DEVONthink and not within the macOS system preferences (system wide)?

But do you know whether the formatting of %recordCreationShortDate% can be adjusted within DEVONthink and not within the macOS system preferences (system wide)?

No. If you want more custom formatting you can use individual date components or AppleScript.

As an example…

Okay I understand - thanks! Unfortunately %recordCreationYear% seems to be only available in the YYYY formatting, not as YY. Therefore I will probably just use the system wide change of the formatting or learn how to script.

But anyway, I appreciate your help! Thanks a lot.

No problem! :slight_smile:

Here’s a simple teaching edition example…

Hopefully that gives some insight and inspiration to dig into AppleScripting. Cheers!

I will definitely take a look at this on the weekend. :blush:

Thanks!