Make Set Selection Aware of Tokens

Hey Mark,

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.

-Chris

How do you mean?

You can insert a token like this:

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.

Hey Shane,

Oh, cool. Thanks.

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?

-Chris

No. Perhaps something like a paste as clipping command would make more sense.

1 Like

No, clipping directives are expanded when a clipping or template script are opened.

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.

Thanks.

-Chris