Use Library for scripting pane

in a clipping, this

“Ensures that a use statement for this framework is present at the start of the script.”

would it be possible to add:


that would ensure that a use statement for this script is present at the start of the script?

In a clipping, then, this:

[[*library:“Myriad Tables Lib” version “1.0.6”]]

would place this:

use script “Myriad Tables Lib” version “1.0.6”

in the appropriate place at the top of the script.

1 Like

Also it would be helpful to have a “use Scripting Additions” option for clippings as well working the same way.

1 Like

Is this feature available in Script Debugger 7.0.3 (7A55)?
I can’t find it anywhere!

Is this really needed? Is there some reason you can’t include it in the template?

There is a Text Substitution, utsa, which will put in a using terms from scripting additions block.

When you’re writing a script with AppleScriptObjC and you want to add some vanilla code from a clipping.
I already have a shortcut for text substitution to add this statement, but this would be a great clic saver!

What do you want to do that the using terms from additions clipping doesn’t do?

Does it make sens?

[[*scripting addition]] --> behaves like library or framework placehoders

set {userButton, gaveUp} to {button returned, gave up} of (display alert "[[template:alertText]]" message "[[template:alertMess]]" buttons {"Annuler", "[[linked-template:Non]]", "[[linked-template:Oui]]"} default button [[template:3]] cancel button 1 giving up after [[template:(5*minutes)]])
if gaveUp = true then return
if userButton = "[[linked-template:Non]]" then
	[[template:-- code]]
else if userButton = "[[linked-template:Oui]]" then
	[[template:-- code]]
end if

I can include it in a template, but that doesn’t help when updating existing scripts.

First, all of the examples I work with have Use script additions, and it’s probably best to work that into the SD auto scripting things.

Second, “using terms from” is a block that requires an “end” at the bottom of the script, and a the same block inside each handler. The use command appears once at the beginning of the script.