4 Replies Latest reply on Feb 8, 2017 12:27 PM by 4everJang

    How to Apply No AttrCondFmts

    frameexpert Level 4

      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

        • 1. Re: How to Apply No AttrCondFmts
          4everJang Level 3

          Doesn't oDoc.ShowAll = true do that?

          • 2. Re: How to Apply No AttrCondFmts
            frameexpert Level 4

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

            • 3. Re: How to Apply No AttrCondFmts
              frameexpert Level 4

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

              • 4. Re: How to Apply No AttrCondFmts
                4everJang Level 3

                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