Hi,
When corrected david's line with out spaces between the Parenthesis and quotes;
 all so worked.  I pointed the script at notepad and tll was printed there when 
I pressed control q. when I tried david's example the spaces between the 
Parenthesis and the quote were the string "tll" was the problem.
david's line as I saw it
> KB.InsertString( "tll" )
In the window-eyes documentation there are no quotes to be seen anywhere. 
GWMicro's brusk discription;
object.InsertString(StringValue)
Line corrected with Parenthesis  and quotes

> KB.InsertString("tll")

this worked for me when pointed at notepad and all so skype, I might add skype 
didn't like, it but it worked.

' point this at notepad if you want to check result.
' notepad must be running and have focus to check result.
dim MyHotkey1 : Set myHotkey1 = Keyboard.RegisterHotkey("Control-q", "NextItem")
Set KB = Keyboard
sub NextItem()
Speak "Next Item"
KB.InsertString("tll")
end sub ' NextItem

regards.
Martin Webster.
--- On Mon, 11/2/09, Doug Geoffray <[email protected]> wrote:

> From: Doug Geoffray <[email protected]>
> Subject: Re: What's wrong here - please help
> To: [email protected]
> Date: Monday, November 2, 2009, 6:35 PM
> 
> 
> 
>   
> 
>  
> David,
> 
> 
> 
> Kill the parenthesis on that line.  Meaning the line
> should read:
> 
> 
> 
> KB.InsertString "tll"
> 
> 
> 
> Only use the parens if you are assigning the method to a
> variable which
> of course you are not here.  This is a VBScript
> thing.
> 
> 
> 
> Regards,
> 
> Doug
> 
> 
> 
> 
> 
> David wrote:
> 
> 
>   
>   
>   
>   Thanks for your
> suggestion. When
> scrolling the WE Script manual, I found the InsertKey, that
> you
> suggested, but also found the InsertString, which seemed
> better. This
> due to the fact, I want to send a string to the keyboard.
> So, I edited
> my script, and it now reads the following. But when
> pressing the
> hotkey, I get the speech, then an error message, which I
> have quoted
> below:
>    
>   dim MyHotkey1 : Set
> myHotkey1 =
> Keyboard.RegisterHotkey("Control-q",
> "NextItem")
> 
> Set KB = Keyboard
>    
>   sub NextItem()
> 
> Speak "Next Item"
> 
> KB.InsertString( "tll" )
> 
> end sub ' NextItem
> 
>   
>    
>   ' error message:
> 
>   type mismatch:
> 'InsertString'
>   0800A000D
>   
>     -----
> Original Message ----- 
>     From:
>     Roy Shtupler
> 
>     To:
>     [email protected]
> 
>     Sent:
> Sunday, November 01, 2009 5:12 PM
>     Subject:
> Re: What's wrong here - please help
>     
> 
>     
>     what does the error
> message say?
>     have you also tried
> using the
> InsertKeys method of the Keyboard object?
>     best
>     Roy.
>     ----- Original Message ----- 
>     
>       From:
>       David 
>       To:
>       Scripting
> List WE 
>       Sent:
> Sunday, November 01, 2009 3:43 PM
>       Subject:
> What's wrong here - please help
>       
> 
>       
>       Hi, 
>       I am trying to write
> a script.
> The following code should press the keysequence
> 
>          
> tll 
>       for me, whenever the
> hotkey is
> pressed. But all that I get, is an error message for the
> line, which I
> have marked with (*). In other words, the (*) itself, does
> not apper in
> the code...
>        
>       dim MyHotkey1 : Set
> myHotkey1 =
> Keyboard.RegisterHotkey("Control--Shift-A",
> "NextItem")
> 
> Set WshShell =
> WScript.CreateObject("WScript.Shell")
> 
> sub NextItem()
> 
> Speak "Next Item"
> 
> (*)WShShell.SendKeys "tll"
> 
> end sub 'NextItem
>        
>        
>        
>       
> 
>        
>     
>   
> 
>  
> 
> 



Reply via email to