Yep.
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!
[[*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
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.