How do I keep original folder and imported files in sync?

I have imported about 1.000 files from one folder (with several subfolders). Now I would like to keep the imported files in sync with the source folder. Meaning that if I save a new file in the source folder it should be imported automatically (or by script, mouseklick etc.) into the database. Or if I delete a file from the source folder it should also be deleted from the database.

I have searched the forum but cannot find a solution how to do this. As I assume that this is a pretty well known standard which many people would like to use I am asking this question here.

Can anybody provide me with an advice?



You’ll need to index the folders/files instead of importing them. Imported files and folders do not maintain any connection to the original source in the filesystem. Search here, or in the manual, on index and also for info on how to keep the two in sync.

I agree with Greg’s advice. To meet your requirement of ensuring that indexed group(s) in DT are updated with additions and deletions from the target folder in Finder, add the “synchronize” script to the top-level indexed group. Open Tools > Show Info for that group, press “Select” next to the Script box, and locate synchronize.scpt on your disk - it is usually in the Extras/Scripts/Examples folder in the DT group in ~/Applications.

[size=85](It is necessary to use Select… to browse and select the script.)[/size]

Sorry for answering so late! Thanks a lot for your advice - I will give this a try.

Hello Greg_Jones,

So, I just want to understand clearly. If I import a text file and make changes in devonthink, then those changes can never appear in the original file; and any changes I make in the original files will never appear in the imported files in devonthink.

However, if I index files into devonthink, then any changes I make, on either end (if I make changes on devonthink or with textedit), then those changes will always be in sync.

Is this true with word and MEllEL files? how about photos? or audio files? or PPTs?

thanks for your consideration

This is true for all files. If you import documents into the database, there is no remaining connection with the original documents. In fact, I suspect that the large majority of DEVONthink users that have imported databases delete the original document from the filesystem. Delete the document in the filesystem and the imported document remains in the database.

The imported documents can still be opened and edited in the original application as needed.

Indexed files behave the opposite-the indexed document in the database can be thought of as an alias to the original document in the filesystem. Delete the document in the filesystem and the document is removed from the database. Delete the indexed document in the database and the user is given the option to delete only the occurrence (alias) in the database or to delete the document from the database and the filesystem.

thank you Greg for the quick reply!

your response made me wonder about how the database is constructed. When I right click on the .dtbase and click show packages, I can see the PDFs or files in a folder called “Files.”

So, this means the .dtBase is pretty safe? I mention this b/c you said some users may delete the original files after importing into DevonThink. So, if I deleted the originals, then even if I didn’t have DevonThink installed, I could open the packages to see the contents. If the .dtBase (database) is safe and reliable, then DevonThink could become an amazing repository for files by storing things very systematically in different databases, and then eliminate so much clutter on the desktop and “documents” folder.

So, my question, or concern, is how safe and reliable is Devonthink and the devonthink .dtBase?


Thanks for your consideration.


That question is impossible to answer. Partially because “safe” and “reliable” are impossible to define in a computing context, partially because any answer depends on your local machine and conditions way beyond DTech’s ability to control. I’d suspect that your answer lies in the the fact that this forum’s postings and web searches for DEVONthink are not flooded with complaints about DEVONthink ruining data and lives.

Over here, my livelihood has depended on DEVONthink working “reliably” since it was first introduced.

OK, I spent 10 minutes drafting my response and the forum software kicked me out when I hit the submit button. Since korm pretty much said exactly what I said, let me add that DEVONthink is more reliable than the forum software! Your data will always be at risk-in the filesystem, in the cloud, in a DEVONthink database. In nearly 10 years of daily use and alpha/beta testing of DEVONthink, I trust it completely with my data.

thank you Greg and Korm for your replies. I think you are right about how nothing is impossible- and the uncertainty of everything.

so, Greg (and / or Korm), do you import your data and then delete the originals?

(thanks again for the interaction on this forum.)

Databases I create for client projects contain indexed groups for the files my clients put on SharePoint repositories. This is their proprietary data and I do not want to comingle it with my workstream data or disperse it into DT’s somewhat obscure folder structure making it difficult to perform complete and secure erasure when the client requires me to do so.

The other case where I index is in my research databases, to incorporate books or media files that I don’t always want to have on-line.

Otherwise, I import or manufacture documents directly in DTPO. Functionally, I find no difference in managing my workflow using the two data storage methods. OTOH, I only use tagging for personal research and not for client work, and I don’t need tag browsing outside of DTPO - so the OpenMeta index-vs-import issue isn’t a factor for me.

I have some imported databases and some indexed databases. The documents from the indexed databases actually reside in a folder structure of a competing app that keeps files visible in the Finder. This allows me to work with my data in either app, although my primary reason for indexing a database is to search and tag documents with Punakea. If/when a) DEVONthink improves its tag search and tag views or b) Punakea can search inside DEVONthink databases, or c) Ammonite continues to improve (personal preference, but I really don’t care for the HUD-style interface) then I will no longer have need to index very many documents into a database.

I also keep the files that are already organized as part of another app’s ‘database’ structure intact in the filesystem. In other words, photos are kept primarily in iPhoto, music and podcasts are in iTunes, less important email is kept in, etc. I do import the more important, project-related emails into DEVONthink. Likewise I index some of my podcasts, my Notational Velocity folder, etc. into DEVONthink and use the synchronize script to keep DEVONthink up to date. I also maintain a small Dropbox folder for collaboration that is indexed into DEVONthink.

Other than what I have described above, for all practical purposes I do not keep any documents in the filesystem. No folders with Pages/Word documents, no Numbers sheets, PDFs, etc. Everything ends up in a DEVONthink database. I sync the documents from my active projects to DEVONthink To Go, to the beta, and also to Dropbox to keep my iPad and iPhone up-to-date, but ultimately everything appears somewhere in a DEVONthink database on the Mac.

I’m interested in syncing these as well, but after exhaustive search of my computer, I don’t see the script described here. Unless it’s under a different name, my Applescript folder doesn’t contain it nor do I have any Extras/Scripts/Examples folder anywhere. In ~/Library/Scripts, I have a folder for DEVONthink Pro, but it only contains 2 scripts.

In DTP Help, under “More Examples”, I see where it refers to Synchronize, which, among others, is supposed to be a download from the website under “Extras”, but there, all I see are bookmarklets. I’ve looked also in the Support Assistant but it doesn’t include it.

Can this be downloaded somewhere? Thanks!

The Synchronize script is included in the ‘Extras’ folder in the DMG disk image from which you installed the application on your computer.