I'm using JMP 9.0.3 64-bit under Windows 7 and automating it from Python using the win32com module. My automation code is based on the JMP 9 Automation Guide, the PDF of which seems now to have disappeared from the website: http://www.jmp.com/support/downloads/pdf/
Here's the bug: the Document automation object has properties Name, FullName, and Path which are supposed to reflect the table name or file name contained therein. However, in many cases these properties turn out to be blank, despite the fact that the table has a non-blank name within JMP, and despite the fact that the automation object for this table can in fact be retrieved using this name.
Here's some Python code that demonstrates the bug. It creates a table using JSL, saves the name of this table, and looks up the table's automation object by name. It then checks whether table.Document.Name in fact matches the known name of the table, and reports the cases where this doesn't hold. It does this 100 times and typically the name starts coming back blank after the first 2-4 iterations:
from win32com.client import gencache
mod = gencache.GetModuleForProgID("JMP.Application")
app = mod.Application()
okay_table = [False]*100
for ii in range(len(okay_table)):
# Create a table in JMP
app.RunCommand("::dt=New Table(); ::retval=dt<<Get Name()")
# Retrieve the name of that just-created table from the JSL variable
retval = app.GetJSLValue("retval")
# Retrieve the automation object for that table, by name
table = app.GetTableHandleFromName(retval)
# Now, table.Document.Name **SHOULD** match retval, but
# it may be blank due to the bug.
if table.Document.Name=="" and table.Document.Path=="" and table.Document.FullName=="":
print "table %d: got blank table.Document.Name; Path=%s, FullName=%s" % (ii,
table.Document.Path, table.Document.FullName)
app.RunCommand("close(DataTable(::retval), nosave)")
okay_table[ii]=False
else:
print "table %d: looks okay; Name=%s, FullName=%s, Path=%s" % (ii,
table.Document.Name, table.Document.FullName, table.Document.Path)
app.RunCommand('close(DataTable("%s"), nosave)' % table.Document.Name)
okay_table[ii]=True
print "Number of bad tables: %d" % okay_table.count(False)
Typical output:
$ python JMP_automation_bug.py
table 0: looks okay; Name=Untitled 304, FullName=Untitled 304.jmp, Path=Untitled 304.jmp
table 1: looks okay; Name=Untitled 305, FullName=Untitled 305.jmp, Path=Untitled 305.jmp
table 2: got blank table.Document.Name; Path=, FullName=
table 3: got blank table.Document.Name; Path=, FullName=
table 4: got blank table.Document.Name; Path=, FullName=
...
table 98: got blank table.Document.Name; Path=, FullName=
table 99: got blank table.Document.Name; Path=, FullName=
Number of bad tables: 98
This bug is becoming quite a show-stopper for me. I quite frequently need to manipulate tables in automation code and then exchange the table names with JSL code, and this bug makes it impossible to do so reliably.
Has anyone else encountered it? Any known fixes or workarounds?