I do try to address a technique for working your way through the scripting
manual, when you have a specific goal in mind, in the wiki scripting article
"so you want to write a script" (part 2) .

However, the scripting manual is a reference work, not a tutorial, and that
may be the real problem you're trying to articulate.

I'm trying to do what I can for a scripting tutorial; and even if you don't
think it's the greatest of works, it is a start if others would consider
helping to improve it.

Even publishing your questions here on the scripting list helps me; they,
and their answers, give me ideas for ways to add to the tutorial articles.
I just added Doug's point about how invaluable the immediate mode script can
be.  so, I'm encouraging you and others to keep asking questions.

Chip


-----Original Message-----
From: Richard Emling [mailto:[email protected]] 
Sent: Tuesday, June 15, 2010 12:04 PM
To: [email protected]
Subject: Re: Getting attributes from text under systemcursor?

Hi Doug.

This is the Information i needed. Thanks a lot. Tell me, is it me beeing to
stupid to understand the WE scripting manual or do i look under the wrong
search strings :-) ?

Best wishes

Richard
----- Original Message -----
From: "Doug Geoffray" <[email protected]>
To: <[email protected]>
Sent: Tuesday, June 15, 2010 3:12 PM
Subject: Re: Getting attributes from text under systemcursor?


> Richard,
>
> I see others responded with good information but I thought I would just 
> show you how to get what you wanted directly.
>
> Lets say I have Wordpad open and my cursor is sitting in a word.  I can 
> then pop up Immed and type:
>
> @print text.character(cursor.position.screenpoint).foregroundcolor.red
>
> Notice the line starts with an @ (at sign).  This is needed because you 
> need Immed to put focus back to the previous application before executing 
> the command.  Otherwise it would use the crusor in Immed which is moving 
> because you just hit enter...blah blah
>
> This command will return the red RGB color of the text.  You can do the 
> same for green and blue.
>
> If you wanted the background then instead of specifying "foregroundcolor" 
> you would specify "backgroundcolor"  That also has an RGB color
>
> If you want the style you can do:
>
> @print text.character(cursor.position.screenpoint).FontStyle
>
> This would return a number which combines the italic, strikeout, 
> underline, bold attributes.  So if you wanted to know if it is bold for 
> example you could do:
>
> @if text.character(cursor.position.screenpoint).FontStyle and fsBold Then 
> : print "it is bold" : else : print "it is not bold" : end if
>
> Hope this helps.
>
> Doug
>
>
> Richard Emling wrote:
>> Hello Scripters.
>>
>> Today i need to know how i can recaive the attributes of text under the 
>> systemcursor. I need the color, and if the text is fat or underlined. 
>> What do i have to type into Immed? By the way, where can i find a 
>> comprehensive reference for everything thats not listed in the WE 
>> scripting reference? I am thinking of the whole activewindow.* stuff. 
>> Microsofts pages don't say something about it.
>>
>> Thanks
>>
>> Richard
> 

Reply via email to