How Do I Edit a Template?


(Jim Underwood) #1

###How Do I Edit a Template?

I don’t see a way to edit an existing SD template.
Did I miss this? If so, please point the way.
I did a thorough search of Help, but it showed only how to save a new template.

Even when I create a new document from a template, and then “Save as Template”, the document remains “untitled”.
It is hard to resave using the existing template name.

If this feature does not exist, please consider this a new feature request.
We should be able to simply select menu item to “Edit Template”, and then when we “Save”, it updates the existing template folder/files.

(Mark Alldritt) #2

The intended usage pattern is that you only ever create templates. To Edit a template, you create a new script based on an existing template, make changes, and save over the existing template.

If you really want to edit a template in-place, you’ll need to locate the template source file within the ~/Library/Application Support/Script Debugger 6/Templates directory. Each template is stored in a bundle with a .sdtemplate extension. There are two files: the template script (Template.scpt or Template.scptd) and its meta-data (TemplateInfo.plist).

You can edit the Template script file if you like. The meta-data can also be edited with anything that can handle property list files.

Note that only content (source, libraries, breakpoints, etc.) from template files are used. All view related settings are taken from the current default view settings (as set with the Windows>Save Script Size & State command).

Here are all the supported meta data Property List keys:

Description - the description that appears for this template in the template chooser
MainTemplateFile - the name of the script file to use
BreakpointsEnabled - are breakpoints enabled?
BreakOnExceptions - is break on exceptions enabled?
AutoIncrementBuildNumber - should build numbers be incremented on save?
CodesignIdentity - the code signing identity to use
PersistentGlobals - are global variables persistent?
HideCodeFolding - hide code folding?
RunInForeground - unused
CocoaTermsInProperties - use properties for Cocoa terms?

(Jim Underwood) #3

My templates are never perfect. All will require editing at some point.

I figured that out. But the process is onerous, since there is no way to reselect the existing template name (it is a folder).

You make it sound like I must be an idiot to want this.
If I didn’t “really want” this, I would not have bothered posting this topic.
Did you see the request for a feature request?

Every other app I’ve used fully supports the opening/editing of the template.

Why not name the actual template script file the same name as the template folder? Then we could just open the actual template script file and it would show a meaningful name. Having all the template script files named “template.scpt” just leads to errors.

Since you are storing the name of the script file, why not make it be useful?

Please accept a feature request to make editing templates easy:

  1. Make template script file same name as template.
  2. Add menu item to “Edit Template”


(Mark Alldritt) #4

Not in the least. I’m just explaining what Script Debugger offers and describing ways of using what exists to accomplish your ends. Your suggestions for improvement have been noted.