Unable to clone and modify Note.templatescriptd

Feels like I’m missing one step in here somewhere…

I followed the DT documentation:

  • duplicated Note.templatescriptd
  • renamed to myNote.scptd
  • used AppleScript Editor to change one word in the script:
    property pTemplateName : “myNote”
  • saved
  • changed name back to .templatescriptd
  • close/open DT
  • Actions/New from Template/myNote gives: "An error occurred while adding the note. Can’t set name of missing value to "myNote: ".

Any suggestions?

The missing step is, if you change the property value, then you need to navigate to this location


~/Library/Application Support/DEVONthink Pro 2/Templates.noindex/Note.templatescriptd/Contents/Resources/en.lproj/Note.rtf

and also change the name of the “Note.rtf” document. This document is the “real” template and the script property has to be the same name – without the “.rtf” extension, of course.

Look further into the script and you will see this statement


set theTemplateFiles to helperLibrary's pathToLocalizedResources() & (((my helperLibrary's localizedString(pTemplateName)) & ".rtf") as string)

into which the code substitutes the value of “pTemplateName” and expects to find a document with that name. In your case, the script failed here.

Thank you, korm.

I would add that from AppleScript, the “Bundle Contents” button on the upper right will enable one to expose the rtf file and change the name.

Good to go now.

In Finder, right-clicking or control-clicking any package (an .app, .templatescriptd, etc.) and choosing “Show Package Contents” will expose the folders inside the package for navigation and editing.