Scripts might look intimidating at first sight, but in fact what Christian supplied IS a “function in software” that will allow you to copy the structure of an existing database, without content.
DT Pro and DT Pro Office are among the most scriptable of Mac applications. That means that many operations that a user might want to add, especially operations that add automation, can be added to the application, which is highly extensible in this way…
You could make a copy of your existing database in the Finder (be sure to close the database first!), then open the copy and go through each group, manually deleting all the content. You would end up with what you desire, an empty database into which you can now add new content.
But that’s sheer drudgery, especially for a large database. The script supplied by Christian will automate the procedure.
Note that DT Pro and DT Pro Office already come with many scripts that you will probably use for various purposes, and they are supplied as “software functions”. In the menubar, click on the Scripts menu (a stylized scroll character) and look at the examples. Would you like to change the Creation Date of a document? The “Set Date” script within the “Dates” folder will let you do that.
You can easily add the script supplied by Christian to the available software functions in DT Pro/Office. Here’s how:
Select and copy to the clipboard the content of the “box” in Christian’s post.
Launch Apple’s AppleScript editor application and paste the contents of the clipboard into it. Compile the script and Save it, e.g., to the Desktop, with a name such as “Create Empty Structure”.
Back in DT Pro/Office, click on the Scripts menu in the menubar and choose the option to open the scripts folder. This will open that folder in the Finder.
Back in the Finder, drag the script you saved into the Scripts folder, placing it either at the top level, in an existing subfolder (if one is appropriate), or in a new subfolder if you wish.
Back in DT Pro/Office, click on the Scripts menu and choose the option to update the menu. Now this procedure will be available any time you wish to copy the structure of an existing database, but without content. You have a new “software function” that’s immediately at hand whenever you wish to use it!
Now that you have seen how a useful new procedure can be added to the application, you might want to keep an eye on discussions in the Scripting section of the user forum. There are many users who write scripts and post them there, and Christian often supplies suggestions and scripts that do what a user needs. You may never tackle the job of writing your own scripts, but you may find and use procedures developed by the user community that make your own work more productive.
NOTE: Whenever the DEVONthink application is updated,the Install Add-ons routine will rewrite the content of DEVONthink’s Scripts menu, which means that you should keep your collection of “extra” scripts copied elsewhere, so that they won’t be lost and can easily be added back.