[Framers] ExtendScript does not set Property ival

Klaus Daube klaus at daube.ch
Tue Dec 8 02:17:58 PST 2020


On 7 Dec 2020 at 14:45, Simon BUCH wrote:

> So, I think you might have to find the property item, and then set the 
> ival [integer value] and sval [string values] like this:
>      var sProps = new PropVals(), flagCombo = 0, index ;
>      index = GetPropIndex(sProps, Constants.FS_FindText)
>      if (index > -1) sProp[index].propVal.sval = sSearch ;

"I'm at the end of my Latin" as we say in German...

I have tested the third method which is for example, used by the Script Of The Week 
"ChangeFormat". Also this does not provide positive results:

/*Test_GetFindParameters.jsx ====== UTF-8 ===========================
              Test for the functions GetFindParameters, FindSomething
Comment       Method proposed by Adobe example
History       2020-12-08
*/ ; // ==============================================================
#target framemaker
//@target framemaker

GetFindParameters ("\\d[st|nd|rd|th]");

function GetFindParameters (sSearch) { //======================
//           Set up a text find with case sensitive RegEx
var findParms, qFlags; 

  findParms = new PropVal;                        // this the reverse 'order'
  findParms = AllocatePropVals(3);                // of my set up

    findParms[0].propIdent.num = Constants.FS_FindText;  
    findParms[0].propVal.valType = Constants.FT_String;  
    findParms[0].propVal.sval = sSearch;  

    findParms[1].propIdent.num = Constants.FS_FindCustomizationFlags ;  
    findParms[1].propVal.valType = Constants.FT_Integer; 
    qFlags = 0; 
    qFlags = qFlags   | Constants.FF_FIND_CONSIDER_CASE; // 0x01
    qFlags = qFlags   | Constants.FF_FIND_USE_REGEX;     // 0x10
    findParms[1].propVal.ival = qFlags;                     // 

    findParms[2].propIdent.num = Constants.FS_RegexFlavour;  
    findParms[2].propVal.valType = Constants.FT_Integer;  
    findParms[2].propVal.ival = Constants.FR_USE_PERL;      // 1

  $.bp(true);   // check findParms
  return findParms;
} //---  end GetFindParameters ---------------------------------------

/* Data Browser at the halt
findParms: [object PropVal],[object PropVal],[object PropVal]
  0: [object PropVal]
    propldent: [object Propldent]
      name
      num: 1
    propVal: [object TypedVal]
      ival: [error] ssval does not have a value
      sval: \d[st|nd|rd|th]
      val: [error] obj does not have a value
      valType: 3
  1: [object PropVal]
    propldent: [object Propldent]
      name
      num: 15
    propVal: [object TypedVal]
      ival: [error] ssval does not have a value
      sval
      val: [error] obj does not have a value
      valType: 1
  2: [object PropVal] 
    propldent: [object Propldent]
      name
      num: 17
    propVal: [object TypedVal]
      ival: [error] ssval does not have a value
      sval
      val: [error] obj does not have a value
      valType: 1
len: 3
length: 3
qFlags : 17
sSearch: \d[st|nd|rd|th]
*/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Klaus Daube             Phone:  +41-44-381 37 77
Schäracher 11           Mail:   klaus at daube.ch
CH-8053 Zürich          Web:    www.daube.ch




More information about the Framers mailing list