Make Set Selection Aware of Tokens


(Christopher Stone) #1

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


(Shane Stanley) #2

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.


(Christopher Stone) #3

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


(Shane Stanley) #4

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


(Mark Alldritt) #5

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


(Christopher Stone) #6

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