Skip to main content
Inspiring
January 5, 2019
Question

find regular expressions in framemaker

  • January 5, 2019
  • 2 replies
  • 1277 views

Hi all,

     how to use Constants.FF_FIND_USE_REGEX with find() method..

i want to find regular expressions in framemaker document using script

please help

This topic has been closed for replies.

2 replies

Inspiring
February 26, 2019

ok

frameexpert
Community Expert
Community Expert
January 5, 2019

I use something like this. I am not sure why I used a literal number on line 22, but I think it was because the constant didn't work.

var doc, findParams, textRange, textLoc;

// Define a text location from where to start the search (not shown);

textLoc = .....;

findParams = getRegexFindParams ("Regular expression string here");

textRange = doc.Find (textLoc, findParams);

function getRegexFindParams (regex) {

   

    findParams = new PropVals ();

    propVal = new PropVal ();

    propVal.propIdent.num = Constants.FS_FindText;

    propVal.propVal.valType = Constants.FT_String;

    propVal.propVal.sval = regex;

    findParams[0] = propVal;

   

    propVal = new PropVal ();

    propVal.propIdent.num = Constants.FS_FindCustomizationFlags;

    propVal.propVal.valType = Constants.FT_Integer;

    propVal.propVal.ival = 16; // Regular expressions

    findParams[1] = propVal;

   

    propVal = new PropVal ();

    propVal.propIdent.num = Constants.FS_FindWrap;

    propVal.propVal.valType = Constants.FT_Integer;

    propVal.propVal.ival=0;

    findParams[2] = propVal;

   

    propVal = new PropVal ();

    propVal.propIdent.num = Constants.FS_RegexFlavour;

    propVal.propVal.valType = Constants.FT_Integer;

    propVal.propVal.ival = 1;

    findParams[3] = propVal;

    return findParams;

}

www.frameexpert.com
Inspiring
February 26, 2019

Hi,

how to find and change the font size of the text in framemaker..it was successfully done using  font/replace dialog..

but how to do it through script?

pls help

4everJang
Legend
February 26, 2019

This question has nothing to do with the original one about regular expressions.

Please repost this as a new topic with another title. It helps getting more people to notice it and it serves future users of the forum to find answers to similar questions.