Skip to main content
Inspiring
Jan 5, 2019 7:09 AM UTC
Question

find regular expressions in framemaker

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 is closed to new replies. Start a new post to keep the conversation going.

4 replies

Inspiring
Feb 26, 2019 6:51 AM UTC

ok

Translate
frameexpert
Community Expert
Community Expert
Jan 5, 2019 4:06 PM UTC

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;

}

Translate
www.frameexpert.com
Inspiring
Feb 26, 2019 6:40 AM UTC

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

Translate
4everJang
Legend
Feb 26, 2019 6:49 AM UTC

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.

Translate