As a simple hack of a fix, you could handle this error by number and
break the search string into a list of 255 character or less chunks.
Then loop through the chunks replacing them.
On Oct 1, 2008, at 5:50 PM, RJay Hansen wrote:
> It does look like that's the problem. I just tested with another
> paragraph. Works with 255 characters. Fails w/256.
>
> RJay
>
>
> On Oct 1, 2008, at 4:08 PM, Paul Skinner wrote:
>
>> It appears that way as your first query was 254 characters and the
>> second exceeded 256. Is there a reason that you are searching for
>> such a large block of text, or are you just testing your code to
>> the edge cases?
>>
>>
>> On Oct 1, 2008, at 5:04 PM, RJay Hansen wrote:
>>
>>> You think there's a 256 character limit?
>>>
>>> RJay
>>>
>>>
>>> On Oct 1, 2008, at 3:22 PM, Paul Skinner wrote:
>>>
>>>> I suspect that it's because the second term is 258 characters.
>>>>
>>>> On Oct 1, 2008, at 3:12 PM, RJay Hansen wrote:
>>>>
>>>>> Using Tex-Edit Plus' "search" command from the Tex-Edit Suite in
>>>>> its AppleScript dictionary, on this paragraph:
>>>>>
>>>>> "And, as Lantano made his way through the basement, among the
>>>>> cots, stepping over people, their meager stores, saying hello
>>>>> here, smiling to someone there, Nicholas thought, _My god, when
>>>>> he came through the entrance he looked like an old man,
>>>>> weathered, dried-out, but now, closer, Lantano appeared middle-
>>>>> aged; the aura of extreme age had been an illusion due to the
>>>>> scrawny quality of the man and the peculiar stiffness in the way
>>>>> he walked; it was as if he were delicate, feared an injury, a
>>>>> fall._"
>>>>>
>>>>> If I do this:
>>>>>
>>>>> tell application "Tex-Edit Plus"
>>>>> search paragraph 2 of document 1 looking for "My god, when he
>>>>> came through the entrance he looked like an old man, weathered,
>>>>> dried-out, but now, closer, Lantano appeared middle-aged; the
>>>>> aura of extreme age had been an illusion due to the scrawny
>>>>> quality of the man and the peculiar stiffness in the"
>>>>> end tell
>>>>>
>>>>> Tex-Edit selects the string within the paragraph and the script
>>>>> returns "true". However if I add one more word to that search
>>>>> string like so:
>>>>>
>>>>> tell application "Tex-Edit Plus"
>>>>> search paragraph 2 of document 1 looking for "My god, when he
>>>>> came through the entrance he looked like an old man, weathered,
>>>>> dried-out, but now, closer, Lantano appeared middle-aged; the
>>>>> aura of extreme age had been an illusion due to the scrawny
>>>>> quality of the man and the peculiar stiffness in the way"
>>>>> end tell
>>>>>
>>>>> I get an error:
>>>>>
>>>>> Tex-Edit Plus got an error: Can't make some data into the
>>>>> expected type
>>>>>
>>>>> with "search paragraph 2 of document 1 looking for......etc"
>>>>> highlighted.
>>>>>
>>>>> Anyone have any ideas what the problem is here? A bug?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> RJay
|