[Framers] ExtendScript does not set Property ival
Klaus Daube
klaus at daube.ch
Tue Dec 8 01:15:39 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 ;
Simon, I just tested this method - and it does not work (or: I made a severe error in
replication):
/*Test_MiniFind-a.jsx ====== UTF-8 ===========================
Test for the functions GetFindParameters, FindSomething
History 2020-12-08
*/ ; // ======================================================
#target framemaker
GetFindParameters ("\\d[st|nd|rd|th]");
function GetFindParameters (sSearch) { //======================
// Set up a text find with case sensitive RegEx
var findParms, index, qFlags, oPropVal1, oPropVal2, oPropVal3;
findParms = new PropVals();
index = GetPropIndex(findParms, Constants.FS_FindText);
if (index > -1) findParms[index].propVal.sval = sSearch ;
index = GetPropIndex(findParms, Constants.FS_FindCustomizationFlags);
if (index > -1) {
findParms[index].propVal.valType = Constants.FT_Integer;
qFlags = 0;
qFlags = qFlags | Constants.FF_FIND_CONSIDER_CASE; // 0x01
qFlags = qFlags | Constants.FF_FIND_USE_REGEX; // 0x10
findParms[index].propVal.ival = qFlags
}
index = GetPropIndex(findParms, Constants.FS_RegexFlavour);
if (index > -1) findParms[index].propVal.ival = Constants.FR_USE_PERL;
$.bp(true); // findParms => empty, null
return findParms;
} //--- end GetFindParameters ---------------------------------------
In all steps the result of index is -4 = Constants.FE_BadPropNum. IMHO this is due to
the fact that I do not check existing properties but a completely empty set (new).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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