batch rename files

How do I batch rename all the files in a particular group?

I think that your group must be imported and not indexed so… I will go from there.

You cannot batch rename in DT-PRO. You have to export the files from Devonthink and then rename them and then import the new files and delete the old ones.

Or I think that you could batch rename them from inside of Devonthink… but then Devonthink will lose track of those files. After you batch rename inside Devonthink do a search for orphaned files by going to the tools menu item and click rebuild database…

After the database is rebuilt you will see a folder titled “orphaned files” and the renamed the files will be in there.

I’m just telling you this from my experience. Make a backup, try it out, and let me know if it works.

Thanks for the reply. I had dreaded that this was the fact.

I find it difficult to understand why this functionality would be missing. There are always cases when using a database that you want to rename a whole load of stuff, especially when importing or cleaning up.

It’s frustrating when workflows that should be simple are not.

Could I ask the devs to please look at this as a serious feature to add.

Now to find a suitable work around.

If you use DEVONthink Pro or Pro Office, you will find several scripts to rename items at Help > Support Assistant - Install Extras - Scripts.

And if you search the forum’s DEVONthink/DEVONnote Scripting section for “rename” you wil find a number of scripts that may give you hints.

It’s not missing (see below).

Not exactly. You can do many renaming tasks using the inbuilt Scripts > Rename > Rename Using RegEx script. If the script isn’t now in your Scripts menu, go to Support Assistant and install it from the Extra’s panel.

1 Like

Thanks guys! just what I was looking for! Didn’t realise you could install scripts through the help assistant!

Makes DT all the more useful nowQ

Hi guys,

have been trying to work out how to batch rename files
using the regex script. As you might have guessed: not working so far.

Could use some help on how to use the script?

What i would like to be able to do:

  • select a number of files
  • replace the current name of the file with a string of words/numbers/whatever.

ex: file names now: 2013_01_16 (date scanned) , etc
want to name them: invoice
(i’ll later add different data in the name to distinguish)

thanks a bunch!

You need to enter a regular expression into the “Enter Source Pattern” dialog, and into the “Enter destination pattern” dialog. A simple pattern that matches document names that only contain characters a-to-z and digits, which you could use as “Source Pattern”, is:


And for “Destination Pattern” you could use


This is a simplistic example. I’d suggest checking out a regex reference such as


I will look into this.

Would this change only selected files? Or ANY files it finds with numbers/letters?

Only selected files.

Ok. work in progress.

Alle files are now named: invoice_invoice_invoice_invoice etc

How could i prevent this?

(ie: just 1 time the word invoice as the name would suffice.)

Or is there another possible way to rename the file (eg: simply replacing the filename entirely on ALL selected files)

I misunderstood your requirement. If you have space in filenames, then for the source pattern use:

[A-Za-z0-9\ ]*

Do not forget the “*” at the end. Note, "\ " is backslash plus space

i just tried .*

that worked too :slight_smile:

thanks A LOT!