Dear Yusuke,
Thank you for your prompt reply.
> On Apr 22, 2017, at 1:57 AM, Kino <[log in to unmask]> wrote:
>
> Hello Nobumi,
>
>> On 2017/04/21, at 23:44, Nobumi Iyanaga <[log in to unmask]> wrote:
>>
>> if $sels.firstValue.length # if there is a visible selection (not just a caret)...
>> foreach $sel in $sels
>> $text.transliterateInRange($sel.range, $map)
>> end
>> else
>> $newDoc = $doc.copy
>> $text = $newDoc.text
>> $sels = $doc.text.findAll '\p{Han}+', 'E', '-am'
>> foreach $sel in $sels
>> $text.transliterateInRange($sel.range, $map)
>> end
>> end
>>
>> -- This works well for the main text part of a file, but not for notes. I would like to make it to work for notes included. I cannot figure out how to do this. Could anyone of you please give me such a macro?
>>
>
> Your findAll command limits the find scope to the main body text only. If you remove '-am', your macro should work for other text objects, including notes, too.
>
> Those options are explained under "The where argument" in "Nisus Macro Reference".
I removed these "where" options, but now, the macro stops at the line:
$text.transliterateInRange($sel.range, $map)
saying that:
The given character index (37002) is out of bounds fot the Text object (length 35039).
What am I doing wrong?
Thank you in advance for your thought.
Best regard,
Nobumi Iyanaga
Tokyo,
Japan
|