I wrote a simple and stupid AppleScript library with sdef.
http://piyocast.com/as/wp-content/uploads/2019/08/checkboxLib.scptd_.zip
This is the sample AppleScript code.
use AppleScript version "2.5"
use scripting additions
use checkLib : script "checkboxLib"
set tList to {"Carrot", "Burdock", "Radish", "Apple", "Cabbage", "Lettuce", "Potato", "Garlic", "komatsuna", " bok choy", " ashiitake mushroom", "Hen of the Woods"}
set cRes to choose checkbox main message "Select Vegetables" sub message "Select vegetables you like" with columns 2 with titles tList
I tried to write JXA script to call this library.
var app = Application.currentApplication()
app.includeStandardAdditions = true
var alib = Library(“checkboxLib”)
var array = [“Carrot”, “Burdock”, “Radish”, “Apple”, “Cabbage”, “Lettuce”, “Potato”, “Garlic”, “komatsuna”, " bok choy", " ashiitake mushroom", “Hen of the Woods”]
alib.chooseCheckbox(
{
mainMessage:“Select Vegetables”,
subMessage:“Select vegetables you like”,
withColumns:1,
withTitles:array
}
)
But this causes error…
Error on line 7: Error: -[__NSCFNumber count]: unrecognized selector sent to instance 0xd7649f5ba840a82b
Is there something wrong with it?
Model: iMac Pro
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.14