How to get the object style properties?
Dear Friends,
I can get a paragraph style by
oPgfFmt = oDoc.GetNamedPgfFmt(sFormat);
However, I have not found a method to get an equivalent for the object style
oObjStyle = oDoc.GetNamedGraphicsFmt (sStyle); // not correct
The famous chm "Adobe FrameMaker-12 Object Model" is outdated and there is nothing relevant in the FDK documentation!
I need to know this to be able to get the properties and then re-apply them to an object in order to remove an override.
Any ideas?
Edit
The ESTK Object Model Viewer is also of no help.
The following script to collect the available styles works as intended:
KLD_F.GetObjFmtList = function (oDoc, asObjFmts) { // =========
//=== Fill array with list of Object format names
var sObjFmt; // name in Catalogue
sObjFmt = oDoc.FirstGraphicsFmtInDoc;
asObjFmts.length = 0;
while(sObjFmt.ObjectValid() == true) {
asObjFmts.push (sObjFmt.StyleTag);
sObjFmt = sObjFmt.NextGraphicsFmtInDoc;
}
asObjFmts.sort (KLD_F.SortNoCase); // otherwise random order !
} //--- end GetObjFmtList --------------------------------------
In particular, this is not possible (I get a loop situation in line 4 and FM must be killed)
function ApplyObjectStyle (oDoc, oObject, sStyle) { // ==============
var oObjStyle, oProps, sStyle;
oObjStyle = oDoc.FirstGraphicsFmtInDoc; // what is this?
oObjStyle = oDoc.GetNamedGraphicsFmt (sStyle); // LOOP / TILT
if (oObjStyle.ObjectValid()) {
oProps = oObjStyle.GetProps();
oObject.SetProps(oProps);
} else {
oObject.StyleTag = sStyle;
}
} //--- end ApplyObjectStyle ----------------------------------------

