I didn't understand the following code in extendscript for framemaker. what is the purpose of findParams and findParams. And why we have to choose findParams.propIdent.num = Constants.FS_FindText; and findParams.propIdent.num = Constants.FS_FindCustomizationFlags; Difference between findParams and findParams. Please explain this individual code.
These are just the options for the Find action, which correspond with the options you see in the UI dialog box. FM can find many things, not just text, so if you are just looking for text, you need to say so. Also, FM makes it optional whether traditional wildcard characters will actually be considered wildcards during the search, because you may just want to just find the actual characters (asterisk, etc.). So, if you want wildcards to be wildcards, you have to say so in your script, just like you have to say so in the UI.
Here is a little more:
var findParams=new PropVals (); //Allocate a new parameter array. Since these are custom objects, this is just how you do it.
findParams = AllocatePropVals(2); //More allocation, to specify two objects. Might have been able to just do "new PropVals(2)", not sure.
findParams.propIdent.num = Constants.FS_FindText; //First parameter identifier... type of search
findParams.propVal.valType = Constants.FT_String; //First parameter value type... will be a string. Just have to do this part. Reasons are legacy.
findParams.propVal.sval = searchString; //The actual string to search for.
findParams.propIdent.num = Constants.FS_FindCustomizationFlags; //Second parameter identifier... specify any special flags. There are multiple.
findParams.propVal.valType = Constants.FT_Integer; //Have to say that the parameter value is an integer. Just have to do this part.
findParams.propVal.ival = Constants.FF_FIND_USE_WILDCARDS; //The special flag(s) to implement, in this case just the wildcards flag.
For any available parameter that you do not explicitly set, the script will use some default value. The documentation provides all default values, which often correspond to the default setup of the associated UI widget.