Guest Spokey Posted May 6, 2005 Share Posted May 6, 2005 Could someone please offer assistance to a software illiterate. I am trying to help a friend who is visually impaired. He uses a program called SAYZME to read text for him. Could someone show me what script he could use to Select All text in the current window (eg open email window) and copy it to the clipboard. I have tried using the send command but have spent hours and got no where. Thanks. Link to comment Share on other sites More sharing options...
herewasplato Posted May 6, 2005 Share Posted May 6, 2005 (edited) Could someone please offer assistance to a software illiterate.I am trying to help a friend who is visually impaired. He uses a programcalled SAYZME to read text for him. Could someone show me what scripthe could use to Select All text in the current window (eg open email window)and copy it to the clipboard. I have tried using the send command but havespent hours and got no where.Thanks.<{POST_SNAPBACK}>AutoItSetOption("WinTitleMatchMode", 4) ;mode four allows for the use of "last" in the next line WinActive("last"); not sure that this line does anything ;activates the last active window - maybe, see manual ;start script without making the desired window lose focus ;something like a shortcut key or voice command launch Send("^a") ;sends a control-a which selects all in MOST applications Send("^c") ;sends a control-c which "copies selected" in MOST applications Send("{HOME}") ;removes the "select all" state ;perhaps other keys would be safer to send Edited May 6, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Guest Spokey Posted May 7, 2005 Share Posted May 7, 2005 Thanks for the code, but it just doesn't seem to work for me. Am I using it wrong? I was producing the .exe file and adding it to my Quick Launch toolbar. I open an email, or notepad text and then click on the Quick launch. The Autoit icon appears for a moment in the sys tray but nothing else happens. The previous window is not reactivated and the clipboard doesn't change. Any advice? Link to comment Share on other sites More sharing options...
piccaso Posted May 7, 2005 Share Posted May 7, 2005 Thanks for the code, but it just doesn't seem to work for me.Am I using it wrong? I was producing the .exe file and addingit to my Quick Launch toolbar. I open an email, or notepad textand then click on the Quick launch. The Autoit icon appears for a momentin the sys tray but nothing else happens. The previous window is notreactivated and the clipboard doesn't change. Any advice?<{POST_SNAPBACK}>try this one:HotKeySet ("{PRINTSCREEN}","go") HotKeySet ("^!q","quit") while 1 Sleep(250) WEnd Func go() Send("^a") Send("^c") Send("{HOME}") EndFunc Func quit() Exit EndFuncrun it, open whatever you want and press Printscreenpress CTRL+ALT+Q to terminatetake a look at the sendkey list in au3helpfile to costumize the hotkeys... CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
herewasplato Posted May 7, 2005 Share Posted May 7, 2005 Thanks for the code, but it just doesn't seem to work for me.Am I using it wrong? I was producing the .exe file and addingit to my Quick Launch toolbar. I open an email, or notepad textand then click on the Quick launch. The Autoit icon appears for a momentin the sys tray but nothing else happens. The previous window is notreactivated and the clipboard doesn't change. Any advice?<{POST_SNAPBACK}>@Spokey,I ran the code on several applications before posting it, but I launched the script via an operating system (OS) shortcut with an OS shortcut key assigned. I suspect that using (clicking on) quick launch shortcut causes the window that you wanted to copy text from to lose focus and the control-a and control-c were sent elsewhere. Since it did not work for you - that confirms my fears that this line, ---WinActive("last")--- has no effect (it only works as documented - imagine that). I should have tested the code on a window that I intentionally took out of focus... but I was not that smart that morning... Anyway, piccaso's code is much better. This assumes that pressing ctrl-a and ctrl-c is not easy for your friend. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Guest Spokey Posted May 7, 2005 Share Posted May 7, 2005 Thanks Guys, all help is very much appreciated. Picasso's code works like a dream. I'll be able to offer this code to others in the disabled community who have problems with multiply keypresses etc. Thanks Again. Over and out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now