Applying Conditional Text with SetProps()

Hi all,
I'm using FM 11 on Windows 7.
I'm having trouble deciphering the scripting guide (http://help.adobe.com/en_US/framemaker/scripting/framemaker_10_scripting.pdf) in relation to the SetProps() function. Specifically, I haven't been able to find a good description of the TypedVal properties (p. 400). Does anyone know of a document that describes these properties and how to use them?
My current task is to apply a conditional format to a row, but I would also like to apply a condfmt to an entire table. Here is my most recent (unsuccessful) attempt:
function setRowConditional(row, condFmt)
    var props = row.GetProps();
    var prop = new PropVal();
    prop.propIdent.num = Constants.FP_InCond;
    prop.propVal.ival = condFmt.id;
    prop.propVal.obj = condFmt;
    props.push(prop);
    row.SetProps(props);
Thanks,
Trevor

Trevor,
To do an entire table, you would need to conditionalize the anchor. The table object itself does not have an FP_InCond property like a row.
Because the anchor is part of the text flow, conditionalizing it is like conditionalizing any piece of text. Having said that, it is tricky to figure out.
Here is thread that discusses the application of a condition to a range of text, in this case a whole paragraph:
https://forums.adobe.com/thread/918670
To adapt this to a table anchor, you would need to have the script "select" an anchor rather than a whole paragraph. You would have to first get the TextLoc property of the table and use it to generate the TextRange required for the anchor. The beginning of the text range would be the original TextLoc and the end would be the same location with the offset incremented by one.
Here is a sample that works for me. Again, I'm not 100% confident that this is the best way to do it. I still get a bit confused about array management within PropVal structures.
function applyConditionToTable(doc, table, condition)
    //Get the format object
    var condFmt = doc.GetNamedCondFmt(condition);
    if(!condFmt.ObjectValid()) return;
    //Get the text location of the table anchor
    var textLoc = table.TextLoc;
    //Set up a text range to span the anchor, a single character.
    var textRange = new TextRange();
    textRange.beg.obj = textRange.end.obj = textLoc.obj;
    textRange.beg.offset = textLoc.offset ;
    textRange.end.offset = textLoc.offset + 1;
    //This will select the anchor. Not required... but handy
    //for testing.
    //doc.TextSelection = textRange;
    //Populate a PropVal array for condition formats
    //by asking for the current value at the beginning of the anchor.
    var props = doc.GetTextPropVal(textRange.beg,Constants.FP_InCond);
    //Reset the PropVal to the condition we want.
    props.propVal.osval[0] = condFmt; 
    //Set the revised properties to the full text range.
    doc.SetTextPropVal(textRange, props); 
Russ

Similar Messages

  • FM 10 Crashing when applying conditional text tag

    Hello everyone.
    For some reason, FM keeps crashing when I try to apply a conditional text tag to a table (entire table). The funny thing is I have been doing this same thing for three months now with no problems before today, even have two tables in the same document with different tags applied to them and they are working fine.  But when I try to add this one, I crash. I have rebooted my computer and made sure all my drivers are up to date, but now I'm at a loss.  Any help?
    Thanks.

    Yes, I can apply the tag to the pictures in the document, its only when applying to the table. I am selecting all rows in the table with the mouse and then selecting the tag, clicking the radio button "in" and then clicking the "Apply" button.  It then asks "apply condition tag settings to all rows in table?" I hit "ok" and then it freezes, screen shots provided.
    Pic 1: My project at table causing problems.
    Pic 2: Me selecting the table and choosing to apply tag.
    Pic 3: Me affirming I want to apply the condition to all rows.
    Pic 4: Program stops responding.

  • Errors trying to apply a Boolean expression for conditional text

    I have been trying to create some Boolean expressions to filter conditional text, with mixed results. The Boolean expression is three conditions separated by ORs followed by four conditions preceded by AND NOTs. When I apply the expression, FrameMaker exhibits and error and has to quit. The numbers in the error message are:
    9004, 4908044, 6134440, 5459515
    The hidden log file appears to be nothing more than a stack dump.
    Do the numbers listed above indicate anything?
    Are there any known limitations on how long a Boolean expression can or should be? One expression with one fewer OR worked.
    Does there need to be a space between an AND and a NOT? The builder does add one, so I assume it is not necessary.
    Does anyone have some general rules of thumb when working with Boolean expressions for conditional text?
    Thanks,
    Van

    Van,
    The error values are meaningless to users. However, please do send the logfiles to the [email protected] address.
    As far as conditionals go, the general rules are that conditon names must be quoted and that if your ar using the NOT, it must run together with the AND or OR, e.g. ANDNOT ORNOT.
    There's an articel in the Developer Connection on using the boolean operators at http://www.adobe.com/devnet/framemaker/articles/fm8_single_sourcing.html
    Perhaps if you posted the condition that caused the crash, someone might be able to spot an error.

  • Question on conditional text design

    I have a relatively large book (230 pages) with dozens of tables and 100's of graphics. I need 4 versions of this book. One for each grade level (3) and one if content for all 3 grades is sold as a "master course."  Other than implementing the conditional text, the book is ready to go. I have tried a couple different ways to approach the  tables conditionally (some of which are in Text Frames, some just anchored to a page ) but I don't get very far.  Applying the Conditional Text tags ( with different colors and markers for each)seems to make it crash (i.e. almost duplicatable unlike the "normal" 3-4 crashes I experience on a daily basis the last month that are just random). Sidenote: I was very happy to see that they are going to fix the book printing crash...
    Cross reference markers are involved in these conditional sections, and I have my suspicions that they are a root culprit of my other crash problems, but then FM crashed when applying conditional text to a section that *didn't* have a x-ref, so I don't know what to think.
    I need to get this out by Monday. So my question is this, if I need 4 tables in a page (one for each version) am I better off just making 4 copies of the book and compiling that way? I sold the client on FM mostly because of the ability to compile multiple docs from one base book..so I really hate to have 4 copies when I give her the source. I know you can highlight individual rows in a table for a version (so I could make one really big table for 3 of the versions and just choose different rows), but this is a thing that seems almost certain to make it crash as well.  And the master tables have an additional column as well as a row so I would still need 2 tables per doc if I could get the conditionals to quit crashing. Is there some better way to "design" this that an experienced FMer could suggest? Some custom utility that works?
    Just in case someone asks this:
    System Config
    FM 11
    new install in August, not upgraded
    Files are all new and native to FM11
    Windows 7-64 bit
    20 gig of memory
    2 TB drive - local C:/
    Thanks for any suggestions on this.

    I think you picked the wrong thread - this one deals with importing or linking FM content into RoboHelp with the TCS.
    I haven't heard of anybody talking about conditional text crashing their FM11 - only issues with Track Changes and Conditions. Have you been reporting these crashes to Adobe Support? Have you submitted your crash logs? Can you reproduce the crashing with a sample book or is it only with this project? Have you tried MIF-washing your content?

  • Conditional Text in  Headers

    I am using FrameMaker 7.2 and trying to insert conditional text into page headers. According to FrameMaker Help, the <$condtag> building block should find and apply conditional text in a page header. However, FrameMaker 7.2 seems unable to find the text with the conditional tag ("2nd edition") that I want in the header. FrameMaker IS able to find the "2nd edition" conditional tag when I use the Find/Change utility.
    This is the the definition of the page header in my document:
    <$paratext[Head2,Head3]><$condtag[2nd edition,\ ]>
    The header that is generated shows a second level or third level heading followed by the text "2nd edition," for example:
    2.1-Storing Files2nd edition
    . . . which is NOT what I want. I want the 2.1 text that I've conditionally tagged "2nd edition" to appear in the header, for example:
    2.1-Storing Customer Files
    Is the syntax that I've used incorrect or is this problem a software bug?

    Arnis,<br /><br />Thank you for your patience and assistance.<br /><br />GOAL<br /><br />From a second edition and third edition document that is one document with conditional tags:<br /><br />* Generate second edition page headers (based on Head2 and Head3 paragraphs) for the second edition document or generate third edition page headers (based on Head2 and Head3 paragraphs) for the third edition document.<br /><br />* Hide second edition page headers on the third edition document. Hide third edition page headers on the second edition document.<br /><br />DEFINITION<br /><br />2nd edition number: 2.1<br /><br />3rd edition number: 201.1<br /><br /><$marker1> building block is for 2nd edition header.<br /><br /><$marker2> building block is for 3rd edition header.<br /><br />Header/Footer $1 marker is for 2nd edition header.<br /><br />Header/Footer $2 marker is for 3rd edition header.<br /><br />I am putting the 2nd edition and 3rd edition section numbers on the same line with the section title, for example (with visible delimiter):<br /><br />2: 2.1 | 201.1-System Administration<br /><br />In the previous example, the tagged heading looks like:<br /><br />(Conditional text tags) <2nd edition>2.1 | <3rd edition> 201.1 |-System Administration<br /><br />(Marker tags) <Header/Footer $1>2.1 |<Header/Footer $2>201.1 |-System Administration<br /><br />Here are the page headers that are generated after Running H/F 5 headers are defined with <$marker1> and <$marker2> building blocks:<br /><br /><$marker1>: 2.1-System Administration<br /><br /><$marker2>: 201.1-System Administration<br /><br />Here is the Running H/F 5 header that is generated after conditional text is hidden:<br /><br />(2nd  edition hidden) 201.1-System Administration<br /><br />(3rd edition hidden) 2.1-System Administration<br /><br />Here is the Running H/F 5 header that is generated when the header is defined with:<br /><br /><paratext[Head2,Head3]>: 2.1201.1-System Administration<br /><br /><paranum[Head2,Head3]>: blank<br /><br /><paranumonly[Head2,Head3]>: blank<br /><br /><paratag[Head2,Head3]>: Head2 (or Head3)<br /><br />Right now when I define the Running H/F 5 header with the <$marker1> building block, only second edition headers show on pages. When I want third edition page headers to show, I must edit the Running H/F 5 header by defining it with the <$marker2> building block. Those are the results that I want!<br /><br />But I am wondering if there is a simple way to hide second edition or third edition headers without having to constantly edit (redefine) the Running H/F 5 header.

  • Adding Conditional-Text conditions in bulk.

    We are importing text from excel using XML via XSLT.
    We would like to mark certain prices (excel columns or Indesign tags) as conditional text.
    We are having a great deal of difficulty in applying conditional text using find-and-replace within Indesign, because of the variation in formatting of prices.
    Below two products, where product B includes a thousands comma separater, a Tax Staus marker in the UK and a Truck Shipping marker in the USA all of which need to be included within the conditional text.
    Product
    UK (X1X)
    Europe (X2X)
    USA (X3X)
    A
    £1.99
    3.50E
    £3.59
    B
    £1,199.00 XV
    3.500.00E
    $3,590.00 T
    Is it possible to apply conditions to tags?
    Is it possible to apply conditions using XML or XSLT?

    This problem was solved by a response to a more focussed question about GREP searching.
    applying the conditions is straightforward once the correct strings have been GREP'd

  • How to build a document with conditional text

    So, I created a condition for a feature that is new to my document and until it's stable, I want to hide that text. No problem. I selected the condition and from the Show/Hide Conditional Text pod, I moved it over to hide. When I created the conditional text, I gave it a background color of gray so I could easily distinguish the conditional text from the non-conditional text. However, if I leave the conditional text visible and go to generate a PDF, the gray background style appears on the conditional text in the PDF. Is there something I'm missing here when it comes to building a PDF? I don't want the style I see in the FM file to appear in the final PDF. I only want that background color as an indicator while I'm editing it. I don't want to have to remember to change the style every time I want to build with the condition visible. Here's a screenshot from the PDF. The bits in gray are what I had applied the condition to.
    After selecting the book file, I tried both doing a Save as PDF and a Print Book but both options ended up with my conditional text having the gray background style in the final output.

    No, you have misunderstood the problem. Yes, If I want to hide the condition so it doesn't print, that works great. But, once the feature is active (or say I have two customers, one that has the feature and one that doesn't), If I want to print the document with the conditional text visible, then I want the text but I don't want the background style that shows up in FM. The conditional style should only appear in FM, not the generated PDF.
    I worked for years with Madcap's Flare and you could set the color of the conditional text in order to distinguish what text was conditioned and with what condition (different colors for different conditions). However, when you generated the output, those colors never showed up. The only thing that displayed was the text that was set to be visible. That's what I was expecting from FM. And the FM tutorials I have taken, that's what they stated should happen. Here's a transcript from the FrameMaker 10 tutorial on Lynda.com:
    When we go down to the Conditional Text pod, you'll notice that we have a number of radio buttons for In, Not In, As Is, and then we also have our tags down below. So this is going to be in the US version. So we'll click the US tag. We'll change the radio button to In. You'll see the status change over here to In, and then we'll apply that by clicking the first button in our group of buttons here to apply it. Now, you'll see something change here in the document and if we deselect our text, you can see it's now blue with the overline and that's how we decided the style and color would appear for our US tags. That's not how it's going to print. It's just for our own visual purposes.

  • Tracking conditional text changes with FRAMEMAKER 8.0

    How do can we track the change of conditional text applied to a given paragraph?
    We are using FRAMEMAKER 8.0
    Thank you in advance for your help

    If you wish to track any changes solely based on applying or removing conditional tags instead of content, then unfortunately FM's tracking mechanisms (Track Changes or Change bars) will not show any of these.
    One way would be to version the documents and then perhaps try using FM's document compare feature (either with the conditions applied or not - I'm not certain if this will show changes in applied conditional tags either, so you may need to actually apply your conditions and then compare documents).

  • Conditional Text in Table - Problems with row height adjustment

    Hey there,
    I’m german but I try to express my problem in english as good as I can. Not always easy with the different menu names. Hope you get what I want to say! :-)
    As you can see in my attached screenshot, I placed text in a table.
    Text height is set to: minimum 1,5 … so it adjusts to the amount of text.
    This is what I want - it should adjust the height to the marked/aktivated conditional text.
    It always adjusts the hight when I blind out the first line oder lines in between (e.g. line 2+3 of 4).
    But if I want to blind out the last line(s), there is a ¶ at the end and a extra blank line with the #.
    I know, the # stands for the following hidden Text, but why does it work with the red/green text.
    There is also text hidden (green), but the mark # is right after the last word - not in a new line.
    Has anyone a solution for this?
    Thanks in advance!

    That's ok so far. A paragraph sign at the end of a text forces a new line.
    To change that do the following:
    For every condition you need another condition just for the paragraph sign that comes immediately after the condition. Not after every paragraph of one condition, but at the end of every consecutive numbers of paragraphs of the same condition.
    So in your third example you'll need two conditions more:
    1. One for the paragraph sign at the end of condition "meaasurements"
    2. One for the paragraph sign at the end of condition "price 2"
    Whenever you make the other conditions invisible, you also have to turn off the new conditions that only control the paragraph signs.
    See the following screenshots:
    Uwe

  • Messages has replaced all my text with a load of letter A's in boxes. What is that all about. When I type a new one it is fine until I hit enter then the same thing applies. Has anyone a fix for this?

    Messages has replaced all my text with a load of letter A's in boxes. What is that all about. When I type a new one it is fine until I hit enter then the same thing applies. Has anyone a fix for this?
    Picture below, many thanks for your help.
    Jason

    Back up all data before proceeding.
    Launch the Font Book application and validate all fonts. You must select the fonts in order to validate them. See the built-in help and this support article for instructions. If Font Book finds any issues, resolve them.
    Start up in safe mode to rebuild the font caches. Restart as usual and test.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t start in safe mode. In that case, ask for instructions.
    If you still have problems, then from the Font Book menu bar, select
              File ▹ Restore Standard Fonts...
    You'll be prompted to confirm, and then to enter your administrator login password.
    Also note that if you deactivate or remove any built-in fonts, for instance by using a third-party font manager, the system may become unstable.

  • InDesign Conditional text batch export with TOC update

    Hello Everyone,
    I'm just getting into the scripting, so bear with me please.
    I have an indesign document with several conditional text variations and a generated Table Of Contents. I've found -hans-'s batch exporting script which works perfectly, BUT, in my document there are conditional headings too, which have their impact on the TOC of course and sadly indesign's toc update is not live. So all I need, is add a line (or 2) in the script that selects and updates the TOC for me before exporting each PDF. I've tried labeling the TOC text frame (with script label) and invoke a menu action on it, but I think I didn't get the Syntax right. I guess for someone experienced this is a really simple task.
    Here is -hans-'s Conditional text batch exporting script:
    http://forums.adobe.com/message/4764443
    thanks for your help!
    wood1y

    Hi,
    Thank you for your answer. This is my syntax so far. All I did to -hans-'s script was, I tried to create a variable with a text frame that has the "TOC" label, select it with a .select action (found it on a forum) that doesn't work, and tried to invoke the update toc with app.scriptMenuActions.itemByID(71442).invoke(); which doesn't work either. So yes, as I told you, I'm a beginner.
    var nameOfThePDFExportPresetYouWantToUse = 'DiscManual' //please don't forget to set!
    var currDoc = app.activeDocument;
    var currFilePath = currDoc.filePath.absoluteURI + '/';
    var currFileName = currDoc.name.replace(/.indd/, '');
    var currConditions = currDoc.conditions;
    var myTOC = currDoc.textFrames.item("TOC")
    //set all conditions visible to false
    currConditions.everyItem().visible = false;
    l = currConditions.length;
    //cycle thru conditions
    while(l--){
    currCondition =  currConditions[l];
    //set actual condition visible to true
    currCondition.visible = true;
    currConditionName = currCondition.name
    //select TOC
    myTOC.select();
    //update TOC
    app.scriptMenuActions.itemByID(71442).invoke();
    //set pdfName
    var exportTo = File(currFilePath + currFileName + '_' + currConditionName +'.pdf');
    //Have a look here:
    //export PDF. to choose backgroundexport. use the second line of code
    //currDoc.exportFile(ExportFormat.PDF_TYPE, exportTo,false,  nameOfThePDFExportPresetYouWantToUse);
    currDoc.asynchronousExportFile(ExportFormat.PDF_TYPE, exportTo,false,  nameOfThePDFExportPresetYouWantToUse);
    //set actual condition visible to false
        currCondition.visible = false;

  • [AS] CS3- Find any text with style, then replace that text with a new applied fill color.

    I am trying to find the simplest way in cs3 to find any text with style, then replace that text with a new fill color. I can find text and change text. I can find a style and change it to a new style. I can't seem to find a style and change the applied fill color. I do not want to change the properties of the style, just the applied color. Yes, I want the + sign, for now. I know, why not update the style, I am not allowed to. Any help would be great. Since the search is not available, I need a new response.
    Thanks.

    You can work around the bug by just doing a find, then looping through the<br />results, changing the color one at a time. It'll be a fraction slower, but<br />should do the trick:<br /><br />tell application "Adobe InDesign CS3"<br />    set find text preferences to nothing<br />    set properties of find text preferences to {applied paragraph style:"The<br />name"}<br />    set theFinds to find text document 1<br />    repeat with i from 1 to count of theFinds<br />        set properties of item i of theFinds to {fill color:"Replace color"}<br />    end repeat<br />end tell<br /><br />The bug is fixed in CS4, BTW.<br /><br />-- <br />Shane Stanley <[email protected]><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>

  • Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.? I want to alter the formatting (i.e., text and/or cell background color), but not cell content.

    Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.?
    I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).

    Hi Tom,
    Your LOOKUP formula will return a value that it finds in the "other" table. That value can be used in conditional highlighting rules. (Numbers 3 calls it conditional highlighting, not conditional formatting. Just to keep us awake, I guess, but it works the same).
    Please explain what you are trying to do.
    Regards,
    Ian.

  • Is there a tutorial/primer for working with conditional text and page numbering in book folders?

    I'm ramping up on FrameMaker 9 and have been experimenting with using folders in book files. I like being able to add Frame files to the folder to organize content. But I also need to use conditional tags. In one version of my book, the entire contents of some files in one folder are hidden using conditional text. I can't figure out how to set the numbering for each file so that the page numbers adjust appropriately in this scenario. Or is it even possible to do this?
    Can anyone recommend an advanced tutorial for using folders in Frame 9?

    Michelle,
    It would be easier to maintain if you create a different book file that omits the entire "conditionalized" set of files.
    See these Adobe TechComm blogs for some more background info on using hierarchical books and numbering behaviour:
    http://blogs.adobe.com/techcomm/2009/05/xml_authoring_projects_using_hierarchical_books.ht ml
    http://blogs.adobe.com/techcomm/2009/06/numbering_in_hierarchical_books.html

  • Conversion with Conditional Text in Table

    I'm taking the first steps in converting Unstructured Frame to Structure. One document is pretty clean except for one issue: my structure breaks around conditional text in tables. (The tables have a f3ew issues oftheir own, but the conditional text seems to compound the problem) I'm not sure how this should be dealt with. The structure tags are shown in the view below.
    And here is the Structure View:
    Is this something that can be set up with a qualifier, and if so, How? Also, in the conversion map table, Is there any order dependency, as well, concerning where the Conditional Text element appears?

    Jane,
    As far as I am concerned I do not see anything unexpected. You get dotted lines in the Structure View apparently because the element <B1_Body1> seems not to be allowed in the Element <CELL>. It looks like you worked with the defaults of the Conversion Table. Have you created your own EDD and imported the Element Definitions? Is <B1_Body1> a legal element inside <CELL>?
    From my experience the Conditional Text feature works very much in parallel to the element structure. It comes from the format-based world and the structure has no means to handle text conditions. If you want to work with text conditions in the future, you would use »attribute-based condition management« as made possible through the plug-in AXCM or FrameMaker’s built-in feature »Filter by attribute«. There is no built-in method to change text conditions into certain attribute values – but it is possible to automate this move via the FDK or FrameScript or ExtendScript (from FM10).
    - Michael

Maybe you are looking for