🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18011

Possible bug in Story search (AS).

#18011
From: John Darnell
Date: Mon, 05 May 2003 18:42
51 lines
3342 bytes
Hello fellow scripters:

My script was crashing with regularity (taking InDesign with it) and it took me the better part of a day to trace it to this line:

...
tell parent story
  search true for "[~B][~I]" replacing with "" as string
end tell

After some tedious testing I determined the following:

1.) If the above string makes up the last eight characters in the story, the script crashes.

2.) If the above string is within six characters and a CR of the end of the story, the script executes correctly.

3.) If the above string is within any other part of the story, the command executes correctly.

4.) If the above string is within six characters and a space of the end of the story, the script executes correctly.

5.) Other strings, if they are within eight characters of the end of the story, and if they are searched for in the story, do not crash InDesign (for example, "robust").

The script I used to test this on looks like this:

tell application "inDesign 2.0.1"
activate
tell active document
tell page 1
tell text frame 1
tell parent story
search true for "[~B][~I]" replacing with "" as string
end tell
end tell
end tell
end tell
end tell

To test the above script, I created a document with a single page in it, and a single text frame on the page. I placed the following text in the text frame:

Text starts after the colon(minus the CR):
This box should be on page 4 and its text should have a point size of (~I)14.[~I]
  (~B)(~I)Indeed[~I][~B] this should be a (~B)(~I)very[~I][~B] interesting oportunity to test the RC code. I am also including the RC code in the TB block, just to see what havoc so doing will cause in the processing of this script. (~I)(~B)I sometimes wonder if I am being hard enough on myself.[~B][~I] After all,
 we have some of the most creative and imaginative people actually creating the scripts right here in the plant. (~I)What if they do a really bad job of it?[~I] (~I)(~B)Do I have enough checks and balances installed to make this process robust?[~B][~I]
:Text ends just before the colon (except ing the CR)

I am saving the document and the script upon which I made these tests if anyone interested in doing so cannot replicate the problem. I would be happy to email both to any one interested in performing their own tests.

I personally am not finished testing this thing. I want to play with the text some more, because as a last test, I eliminated all characters except the above string from the text and the script did not crash. Curiouser and Curiouser.

If there is a better way to report this possible bug, then please let me know.

TIA.
Technical Details
Message-ID: <1de9003f.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e0bb922fa0b0dec7
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-05 12:08:06 PST
From: "John Darnell" <John.Darnell@Walsworth.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Possible bug in Story search (AS).
Message-ID: <1de9003f.-1@WebX.la2eafNXanI>
Date: Mon, 5 May 2003 11:42:44 -0700
Lines: 75
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit