Yep. Getting this error:
Any ideas/suggestions?
One Note: Where you had “missing data” in AppleScript, I used “null” in JavaScript.
Is this correct?
I also tried an empty string “”, but got same results.
Actually JavaScript
'use strict';
var app = Application.currentApplication()
app.includeStandardAdditions = true
var myLib = Library('JMichael.Lib.JXA')
var MTLib = Library('Myriad Tables Lib')
myLib.helloJS("Called by JXA script") // works fine
var theHeads = ["First Name", "Last Name", "Index", "Police", "Score", "Some Date"]
var theDate = new Date()
var someData = [
["Saga", "Norén", 1, true, 12.0, theDate],
["Rasmus", "Larsson", 2, true, 13.5, null],
["Freddie", "Holst", 3, false, 9.0, (theDate + 40000)],
["Claes", "Sandberg", 4, false, 1.23456789E+4, theDate + 50000],
["John", "Lundqvist", 5, true, 13.4567, theDate + 30000],
["Annika", "Melander", 6, false, 22.0, theDate + 60000]
];
console.log(someData)
/*
--- AppleScript Code ---
set myTable to ¬
make new table with data someData ¬
with title "Sample table" column headings theHeads ¬
with prompt ¬
"You can drag/drop, select multiple rows. Everything is editable. Uses a row template" editable columns {} ¬
row template {"", "", 1, true, 1.0, current date, missing value} ¬
with multiple selections allowed, row numbering and empty selection allowed
*/
var myEditCol = []
var myRowTemplate = ["", "", 1, true, 1.0, theDate, null]
//*** NEXT LINE GIVES ERROR ***
// Script Error
// Error on line 45: Error: Script error.
var myTable = MTLib.makeNewTableWithData(someData,
{withTitle: "Sample table",
columnHeadings: theHeads,
withPrompt: "You can drag/drop, select multiple rows. Everything is editable. Uses a row template",
editableColumns: myEditCol,
rowTemplate: myRowTemplate,
multipleSelectionsAllowed: true,
rowNumbering: true,
emptySelectionAllowed: true
}
);
REPLIES PANEL:
app = Application("Script Editor")
app.displayAlert("From My JXA Lib: Called by JXA script")
--> {"buttonReturned":"OK"}
/* Saga,Norén,1,true,12,Sun Feb 14 2016 20:31:23 GMT-0600 (CST),Rasmus,Larsson,2,true,13.5,,Freddie,Holst,3,false,9,Sun Feb 14 2016 20:31:23 GMT-0600 (CST)40000,Claes,Sandberg,4,false,12345.6789,Sun Feb 14 2016 20:31:23 GMT-0600 (CST)50000,John,Lundqvist,5,true,13.4567,Sun Feb 14 2016 20:31:23 GMT-0600 (CST)30000,Annika,Melander,6,false,22,Sun Feb 14 2016 20:31:23 GMT-0600 (CST)60000 */
app = Application("Script Editor")
app.alloc([])
--> Error -1708: Message not understood.
Result:
Error -1753: Script error.