Newbe Questions about Script-Template PLIST File

Hello Folks

I think that it’s time for me to post here for almost the first time …

I’ve been reading and of course re-read a lot of stuff I found here in this forum when it comes to an Automation-Point-of-View using AppleScript … just for any case.

As I mentioned above I have read a lot of stuff here - but I think I never have read about what can be done with the Template.plist file - which I am getting every time when creating a new Script-Template.

I am building a lot of snippets for writing Scripts for my own at the moment - and of course I am creating Scripts & and Script-Templates.

Exactly this brings me to the Questions I have for you Guys:

  • Can I apply a custom Icon to my Template ?

    • How is this possible? (thinking of a file reference)
  • How can I apply my own Description (Custom Title & Description Text) ?

I have a lot of Templates (50+) and they’re growing and I want to have them displayed with the Iformation for what they are for in the Open File Dialog properly.

Maybe you can help me out with this Questions.

Many Greetings from Germany - and stay safe :wink:

Tobias

1 Like

Please see this topic for more information on customizing templates. There is a section at the end of the post on changing a template’s icon:

We don’t document the internal structure of templates because the official interface is limited to Script Debugger’s Save as Template command. This said, some information has been provided over the years.

See this:

and this:

Many Thanks for that @alldritt

That helped me a lot…
Maybe you can help me one more time because this is absolutely new to me - I’ve put all the Infos I needed for the PLIST together in one Draft - which you can see here:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
      <key>Description</key>
      <string>The Script You can create with this Template is Code-Signed and has Persistent Variables.
      </string>
      <string>It has an Auto-Incrementing-Feature for Buildnumbers on Saving; - and also these others:
      </string>
      <string>* Breakpoints: Enabled</string>
      <string>* Break on Exceptions: Enabled</string>
      <string>* Code-Folding: Enabled</string>
      <string>* Cocoa-Terms in Properties: Enabled</string>
      <key>MainTemplateFile</key>
      <string>Template.scpt</string>
      <key>BreakpointsEnabled</key>
      <true/>
      <key>BreakOnExceptions</key>
      <true/>
      <key>AutoIncrementBuildNumber</key>
      <true/>
      <key>CodesignIdentity</key>
      <string>com.my-awesome-developername</string>
      <key>PersistentGlobals</key>
      <true/> 
      <key>SDHideCodeFolding</key>
      <false/>
      <key>CocoaTermsInProperties</key>
      <true/>
</dict>
</plist>

As an Output It should show me something like this:

The Script You can create with this Template is Code-Signed and has Persistent Variables.
It has an Auto-Incrementing-Feature for Buildnumbers on Saving; - and also these others:
    * Breakpoints: Enabled
    * Break on Exceptions: Enabled
    * Code-Folding: Enabled
    * Cocoa-Terms in Properties: Enabled

Is something like this possible? - Or did I something wrong here?

Greetings from Germany - and stay safe

Tobias

You asked for my help in our PM, but I have not worked with the Template PLIST at all, so I know nothing that would help.

You are only allowed a single paragraph of text in the Description key. In your example you have multiple <string> values associated with the Description key which will fail. Combine the text of all your <string> elements into a single <string> element and it should begin to work.

Thank you @alldritt

I’ll figure out what is possible …

What’s about the max. Icon Size on the TemplateIcon.icns - File ?? are there limitations such as 256x256 - or can I use the full Size from an macOS based Iconset; the 512x512@2x ??

That’s all for now…

Greetings from Germany - and stay safe

Tobias

You need to create an icns file. This type of image file lets you embed images at multiple sizes. You can use a full icon set ranging from 16x16 to 1024x1024. Script Debugger will only use 32x32 and 64x64 but the Finder may use others.