NISUS Archives

December 2010

NISUS@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Sat, 25 Dec 2010 23:04:06 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
Hello Nobumi,

On Dec 25, 2010, at 10:19 PM, Nobumi Iyanaga wrote:

>> # Get the active (and first) Text Selection object.
>> $selActive = TextSelection.active
> 
> I guess this "active (and first) Text Selection object" may be either the first actually selected text, or, when there is no selection, the first character of the document, or perhaps more probably the first character after the insertion point...?

In NWP macro, "selection"  means not only a visible selection but also a zero-width selection, i.e. insertion point. So  TextSelection.active returns always something valid unless there is no open document.

Same with selectedSubstrings command. This is why $selectedTexts.count in your macro returns 1 when just an insertion point exists in the frontmost document window.


>> 	# to apply style attributes on a variable ($linkText).
>> 	Push Target Text $linkText
>> 		$lang.apply
>> 		Set Font Size $fontSize
> 
> These two lines seem to apply to the $linkText the "language attribute" and the "font size attribute - 1" of the "active (and first) Text Selection object", which were found at the beginning of the macro. I guess these attributes may not be the same at the place of the insertion, don't they...?

Ah, the purpose of that command is to control NWP's font assignment. The target document and hyper links' destination texts (url) are mainly in Japanese. However, the latter are stored as plain text. Then, if I run this macro without applying the language, Japanese characters will be inserted in substitute font (Hiragino-KakuGothic). Probably this is due to my language settings both in OS X and in NWP (British English). However, With Japanese language on $linkText, Japanese font (Hiragino-Mincho) used in the document is used in the output.


Kino

ATOM RSS1 RSS2