Copy link to clipboard
Copied
I have a document containing structured table elements. The tables contain user string information [used by the FDK for tracking purposes], but when I apply a simple script to modify the table shading, I then find the UserString no longer exists on the table. [I checked this by comparing the MIF statements].
My outline script is:
doc = app.ActiveDoc
tbl = doc.FirstTblInDoc
tblfmt = doc.GetNamedTblFmt ("RouteTable")
prop = tblfmt.GetProps()
tbl.FirstRowInTbl ; cell = row1.FirstCellInRow ; cell.CellUseOverrideShading = true ; cell.CellOverrideShading = null ; cell.CellUseOverrideFill = true ; cell.CellOverrideFill = 3 ; // change the table
tbl.SetProps (prop) // apply the changes
According to the FrameMaker scripting guide, only Element and CombinedFontDefn objects can hold user strings.
How can I modify the table [with table tag "RouteTable"] while retaining the Table's UserString?
Copy link to clipboard
Copied
kilt,
This could be a tough question. UserString support for various objects has always been a bit uncertain to me. As you mention, FDK and ES docs only list the property for a couple of object types, but it seems to work in many places when used with the FDK.
ES seems different and perhaps it's a bug. It does seem certain that ES does not support the property on a table object, but I don't know if that is by design. The documentation suggests that it is. If so, it would seem that you got lucky with the FDK but that luck ran out with ES.
You said these are structured documents. Any particular reason that you can't use the element object instead? The UserString property seems to work reliably with those.
Russ
Copy link to clipboard
Copied
Hello Russ,
Thank you for the response. After reviewing my code, it appears that I was using GetProps() from the table format, whereas I should have referenced the GetProps() from the tbl.
Copy link to clipboard
Copied
I noticed that, but thought maybe it was on purpose. Either way, I don't think it is related to the UserString problem.
Copy link to clipboard
Copied
The Userstring has been problematic in Extendscript, whereas it works fine in FrameScript for every object. Rick Quatro has been back and forth with the engineers and they have made some fixes, but it still doesn't work in a reliable manner. Hopefully, Rick will jump in here and add some more details.