Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Nigel Garvey <email@hidden>
- Date: Tue, 19 Feb 2002 12:22:28 +0000
In my message of Tuesday, 19 February 2002 11:08:36, I wrote:
>
Shane Stanley wrote on Tue, 19 Feb 2002 11:54:42 +1100:
>
>
>On 19/2/02 10:32 AM +1000, Pat Cannon, email@hidden, wrote:
>
>
>> repeat
>
>> try
>
>> set nextPointer to pointer + chunkSize
>
>> set pdfText to read pdfFile from pointer to nextPointer
>
>> if pdfText contains searchString then
>
>> set textFound to true
>
>> exit repeat
>
>> end if
>
>> on error -- I'm assuming the error is EOF
>
>> exit repeat
>
>> end try
>
>> set pointer to nextPointer
>
>> end repeat
>
>
>But you're not allowing for the possibility of "CalGray" falling across the
>
>boundary of two chunks. To be safe, you need to do something like store the
>
>last paragraph of each chunk, then concatenate the next chunk to it each
>
>time.
>
>
Or, at the end of the loop, set pointer to nextPointer - searchString's
>
length + 1.
Another problem that's just occured to me is that the search string might
be in the short stretch at the end of the file that isn't read because of
the EOF error. You need to make arrangements to read this last section,
if it exists.
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.