I attended Meet the Developers session today in the Discovery Summit to ask about this. It seems that a solution like the one I posted earlier (get column names, N Items() those for column count, open datatable with one column as private and N Rows() for row count) is currently the fastest way to do this. They took a note so maybe in future it will be possible without opening even private datatables or JMP will provide functionalities to do this.
Below is the script in function format. They suggested to add Close for the dt_temp. This script might need Wait(0); here and there, but as it did work without them I haven't added any.
Names Default To Here(1);
//https://community.jmp.com/t5/Discussions/Accessing-jmp-file-row-col-count-and-notes-without-opening-file/td-p/366316
//Function to get column count, rowcount, table notes and column names to associative array
getTableInfo = function({path_to_table}, {Default Local},
//Check that file exists
If(!File Exists(path_to_table),
return(Associative Array({"error"}, {"File not found"}));
);
//Initialize associative array
retVal = Associative Array(
{"name", "rowCount", "columnCount", "notes", "columnNames"},
{"", 0, 0, "", {}}
);
//Open datatable as columns only list
colNames = Open(path_to_table, "Column Names Only");
//Check that table has atleast one column
If(N Items(colNames) > 0,
retVal["columnNames"] = colNames;
retVal["columnCount"] = N Items(colNames);
dt_temp = Open(path_to_table, Select Columns([1]), Private);
retVal["name"] = dt_temp << get name();
retVal["rowCount"] = N Rows(dt_temp);
);
//Get notes from "Notes" table variable
retVal["notes"] = dt_temp << Get Table Variable("Notes");
Close(dt_temp, no save);
return(retVal);
);
//Examples with tables from $SAMPLE_DATA
aa_probe = getTableInfo("$SAMPLE_DATA/Probe.jmp");
Show(aa_probe["name"],aa_probe["rowCount"], aa_probe["columnCount"], aa_probe["notes"]);
Show(getTableInfo("$SAMPLE_DATA/Alcohol.jmp"));
Show(getTableInfo("$SAMPLE_DATA/Alcohol.jmpmissing"));
-Jarmo