Copy link to clipboard
Copied
Hello all,
I have read and tried the Find/Replace script that was posted by Russ / Ian last year, and made some modifications to get the result that I need: finding any paragraph that has a particular paragraph format tag. It does not work and I fail to see why.
Entering the "WritersNoteText" paragraph tag in the Find function gives me plenty of hits. But using ExtendScript there is nothing, just an error code -2. Using PrintErrno translates this error code into FE_Success.
var doc = app.ActiveDoc;
var findParams = new PropVals();
var trange = new TextRange();
flow = doc.MainFlowInDoc;
frame = flow.FirstTextFrameInFlow;
trange.beg.obj = trange.end.obj = frame.FirstPgf;
trange.beg.offset = trange.end.offset = 0;
findParams = AllocatePropVals (1);
findParams[0].propIdent.num = Constants.FS_FindPgfTag;
findParams[0].propVal.valType = Constants.FT_String;
findParams[0].propVal.sval = "WritersNoteText";
FA_errno = Constants.FE_Success;
trange = doc.Find (trange.beg, findParams);
if ( FA_errno == Constants.FE_Success ) {
doc.DeleteText( trange );
} else {
PrintErrno ();
}
Where's the error in my code or in my thinking ?
Jang
Strange things happening here. I restarted Windows and FM10 and the same script works... In Debra Herman's blog I found a reference to an include file for the FDK that lists at least some of the error codes - that showed that the -2 was an invalid book or document. There must have been some bad communication going on between the ESTK and FM10 when I was testing my script.
Anyway, on to the next pitfall...
Ciao
Jang
Copy link to clipboard
Copied
Strange things happening here. I restarted Windows and FM10 and the same script works... In Debra Herman's blog I found a reference to an include file for the FDK that lists at least some of the error codes - that showed that the -2 was an invalid book or document. There must have been some bad communication going on between the ESTK and FM10 when I was testing my script.
Anyway, on to the next pitfall...
Ciao
Jang
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more