Copy link to clipboard
Copied
I am trying to Show All Attribute Expressions (Special > Filter by Attribute) using ExtendScript. I can do this:
#target framemaker
var doc = app.ActiveDoc;
var attrCondExpr = doc.FirstAttrCondExprInDoc;
while (attrCondExpr.ObjectValid () === 1) {
attrCondExpr.AttrCondExprIsActive = 0;
attrCondExpr = attrCondExpr.NextAttrCondExprInDoc;
}
And it does switch the "Manage Attribute Expressions" Show All radio button to on. The problem is that it does "Apply" the change to the document. There is an ApplyAttributeExpression() method on the AttrCondExpr object, but there is nothing on the document. I don't want to apply a particular filter; I want to apply no filter to show everything. Any help would be appreciated. -Rick
Doesn't oDoc.ShowAll = true do that?
Copy link to clipboard
Copied
Doesn't oDoc.ShowAll = true do that?
Copy link to clipboard
Copied
Thank you Jang! Simple, but it looks like it works.
Copy link to clipboard
Copied
One more thing about these Attribute Condition Expressions: there is no Name property that matches the name in the interface. At least not that I can see....
Copy link to clipboard
Copied
Hi Rick,
Although I have only used Build Expressions on the conditional tags (not on attributes), the processes are probably similar. I think what happens is this when you set the last attrCondExpr to not active, FM sets the default expression to be active. At least that is what seems to happen with the Build Expressions for conditional content.
Setting the default expression does exactly this: setting the default expression. This in itself does not change the status of the conditional content. That is what I can see in the Expression Builder and related Conditional Text display panel. In fact, to make a change visible in the content, I needed to switch it back to False and then True again. Just changing the expression did not register any change in the FM document.
Glad to be able to help you out.
Kind regards from Prague - a beautiful but very very cold city.
Jang