Sunaj Posted October 1, 2006 Share Posted October 1, 2006 Ok, I've made a small script to manipulate text it gets the selected text in a given word/txt file by me pressing a hotkey, the important bit goes like this: ...... Send("^c") ClipPut(StringLower (ClipGet())) Send("^v") ...... The problem is that the Send("^c") way of getting the text does not come through as 100% reliable - often when the script is run for the first time it will fail simply by Send("^v")'ing the last copied item instead of the one currently selected. Any ideas for replacing the Send("^c") method of getting the text plus ideas for error correction would be highly appreciated. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
creeping Posted October 1, 2006 Share Posted October 1, 2006 Try slowing things down a wee bit by using some sleep commands, see if it makes a difference HotKeySet("{F6}", "CopyText") HotKeySet("{F7}", "PasteText") While 1 Sleep(10) WEnd Func CopyText() Send("{CTRLDOWN}") Sleep(100) Send("c") Sleep(100) Send("{CTRLUP}") EndFunc Func PasteText() Send("{CTRLDOWN}") Sleep(100) Send("v") Sleep(100) Send("{CTRLUP}") EndFunc Link to comment Share on other sites More sharing options...
Sunaj Posted October 1, 2006 Author Share Posted October 1, 2006 (edited) Try slowing things down a wee bit by using some sleep commands, see if it makes a differenceThanks for quick reply, it DOES make a difference, however, the thing is I would much prefer a more 'cleancut' approach to the problem (i.e. solving it with a system/dll call of some sort or another) since the sleep command way of 'fixing' it is more of a workaround - if the system is under stress or the script is used on a slower computer it is likely to fail.btw: it does seem to do a difference simply to use the Send("{CTRLDOWN}")/Send("{CTRLUP}") without all the sleeps - i'll report back if the fix is stable Edited October 1, 2006 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
Bert Posted October 1, 2006 Share Posted October 1, 2006 I've ran into the same problem, and I ended up doing the command ctrl +c twice. That made it 100%. I know, not clean, but it works. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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