• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to Apply No AttrCondFmts

Community Expert ,
Feb 08, 2017 Feb 08, 2017

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

TOPICS
Scripting

Views

361

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Feb 08, 2017 Feb 08, 2017

Doesn't oDoc.ShowAll = true do that?

Votes

Translate

Translate
Advocate ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

Doesn't oDoc.ShowAll = true do that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

Thank you Jang! Simple, but it looks like it works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2017 Feb 08, 2017

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....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines