Confused about creating template/script

I’ve read through the user documentation for DEVONthink Pro, in addition to reading through some of the threads on this forum. I want to create a couple of simple templates that are like the templates “Online Account”, and "Email Account: (New From Template -> Accounts & Passwords -> Email Account).

I’ve tried many of the suggestions mentioned in the help documentation and those found here in the forums, including copying one of the templates/scripts and using them as an example, but there is no indication for who I would be able to create a template when the one I’ve copied seems impossible to modify or understand.

Is there a specific application that I need (tried TextWrangler but couldn’t get anywhere with it, and didn’t really understand how to use TextWrangler itself).

Any help would be greatly appreciated.

Let’s say you want a custom version of ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex/Accounts & Passwords/Email Account.dtTemplate.

  1. You select that template in Finder, and duplicate it – command-D
  2. You rename that duplicate to a name you like. I’ll call it "My Template.dtTemplate
  3. In Finder, right click My Template.dtTemplate and select Show Package Contents
  4. This reveals the contents of the .dtTemplate “package” – the term for a kind of folder in OS X whose contents are normally hidden
  5. In the template package, navigate to the subfolder named “English.lproj” – I’m assuming you want to modify the English version. If not, then modify the French or German version, which reside in their own folders.
  6. Inside English.lproj you will find the actual template – at file named, creatively, “Email Account.rtf” (You may, optionally, rename that file, but it is not important if you do not.)
  7. This is a normal RTF file. Open it in your favorite RTF editor (or TextEdit) and make the changes you wish.
  8. Among the changes you can make are modifications to “placeholders” – the text strings like %username%
  9. You may add to your template any of the “placeholders” listed in Help > Documentation > Appendix > Templates > Template Packages
  10. As Help states: During import they [the placeholders] are replaced with actual data – i.e., your data

Now, you might not want those placeholders mentioned in #9, but different placeholders – custom placeholders. That’s a little harder to do, and you would need to create what Help calls a Smart Template. The instructions are in Help, and there are threads on this forum that explain that process in detail – I’ve posted two of these long threads myself. Advanced Search can locate them. Or, check the Manual from page 125 on.

I would suggest working the process listed above before adventuring into scripting. In either case, you might get a refund on TextWrangler – it is not needed here at all. :slight_smile:

Thanks for your instructions! I was able to copy one of your templates, but I can’t figure out how to create addition fields. I am unfamiliar with the .rtf code that is being used. If I go to the last field on the form and press enter, I am not able to add a new line. It appears to be a table, but I can’t figure out how the alignment works. Do you have any suggestions that might help me? Thanks!

RTF is Rich Text Format – a common type of text file that lets you use different fonts, styles (bold, underlined, italic), tables, and other features that are not available with plain text files. Some people find RTF table editing frustrating – I know I do. (BTW, this is an OS X thing – not directly related to or controlled by DEVONthink.)

But, this isn’t the best forum for learning to edit RTF files – we would merely be repeating what has been said better elsewhere. For example, open the file in TextEdit (which comes installed on your Mac) and check the Help file sections about adding and editing tables. Perhaps also do a web search on “TextEdit Tutorials” – there are a number of You Tube videos that are very helpful, as well as tutorials on MacTuts and other resources.