As far as I know there is no way to employ the token/template system outside of Script Debugger’s built-in clippings, text-substitution, and templates.
It would be really nice if set selection had a parameter to make it token-aware.
tell application id "com.latenightsw.ScriptDebugger6" -- Script Debugger.app
tell document 2
set contents of selection to "Put #~token~# here"
end tell
end tell
It will compile to a token in Script Debugger, and it will insert a token.
Let’s make it work such that Script Debugger doesn’t eat the token, when you paste the script:
set theToken to "Put #" & "~token~" & "# here"
tell application id "com.latenightsw.ScriptDebugger6" -- Script Debugger.app
tell document 2
set contents of selection to theToken
end tell
end tell
You still can’t work with things like [[select:]] though – right?
It would be nice then to be able to properly emplace or otherwise expand any Script Debugger template language when setting the selection, so that idea works as far as I can see.