HARNOvHARNO Posted December 15, 2004 Posted December 15, 2004 (edited) how can i read marked text? i want to mark some text with the mouse, and read it when i bush a key (save it to var a for later use) Edited December 15, 2004 by HARNOvHARNO
Doxie Posted December 15, 2004 Posted December 15, 2004 (edited) This is what i could come up with, far from finish, but it might give you an idea how to continue. HotKeySet('!w', 'Copy'); Set Alt-W to copy Sleep ( 5000 ) Func Copy(); Alt-W Hotkey function ClipPut("Test") MsgBox(0, "Clipboard contains:", ClipGet()) EndFunc You need to change the "Test" to use Copy (CTRL+C) and also make the program stay idle, and not only for 5 seconds Edited December 15, 2004 by Doxie Were ever i lay my script is my home...
HARNOvHARNO Posted December 15, 2004 Author Posted December 15, 2004 (edited) This is what i could come up with, far from finish, but it might give you an idea how to continue.HotKeySet('!w', 'Copy'); Set Alt-W to copy Sleep ( 5000 ) Func Copy(); Alt-W Hotkey function ClipPut("Test") MsgBox(0, "Clipboard contains:", ClipGet()) EndFuncYou need to change the "Test" to use Copy (CTRL+C) and also make the program stay idle, and not only for 5 seconds <{POST_SNAPBACK}>the reson is that im trying to improve the clibbord in windows so i can save more information then normal, when i know more about this i mey improve the file/picture part to if this can be done in autoit.here is what i have so far, my idea was to make my own clibbord without eny use of the one in windows. but it might be beter to use it.-----;here im trying to copy the information to my own clibbord;a text file at my hard drive, witch can contain moch more informationHotKeySet('!w', 'Copy'); Set Alt-w to copyFunc Copy(); Alt-W Hotkey function $cb = ClipGet() IniWrite(@scriptdir & "\bord.ini", "bord", "1", $cb)EndFunc$idle = 0Do Sleep ( 100 )Until $idle = 10 Edited December 15, 2004 by HARNOvHARNO
Doxie Posted December 15, 2004 Posted December 15, 2004 May i ask what you gonna use it for? I see you use $cb, is it for Utopia? Were ever i lay my script is my home...
HARNOvHARNO Posted December 15, 2004 Author Posted December 15, 2004 (edited) May i ask what you gonna use it for?I see you use $cb, is it for Utopia? <{POST_SNAPBACK}>cb - clibbordits my dad there need it to copy some bank account numbers when paying bills, and it might be usefull for other stuff aswhell. i think its a grath idea to improve the clibbord in windows a little. :-)here is my script, for now its seying Send{CTRLUP} Send^ËRRORerror: unable to parse line---when running this below---HotKeySet('!1', 'Copy1'); Set Alt-1 to copy Func Copy1(); Alt-1 Hotkey function Send("{CTRLDOWN}");Holds the CTRL key down until {CTRLUP} is sent Send("{c down}");Holds the c key down until {c up} is sent Send{CTRLUP};Releases the Ctrl key Send{c up};Releases the c key $cb = ClipGet();gets data from clibbord IniWrite(@scriptdir & "\bord.ini", "bord", "1", $cb);saves it to a file EndFunc HotKeySet('!2', 'Copy2'); Set Alt-2 to copy Func Copy2(); Alt-2 Hotkey function Send("{CTRLDOWN}");Holds the CTRL key down until {CTRLUP} is sent Send("{c down}");Holds the c key down until {c up} is sent Send{CTRLUP};Releases the Ctrl key Send{c up};Releases the c key $cb = ClipGet();gets data from clibbord IniWrite(@scriptdir & "\bord.ini", "bord", "2", $cb);saves it to a file EndFunc $idle = 0 Do Sleep ( 100 ) Until $idle = 10---okay a way that allmost works---HotKeySet('!1', 'Copy1'); Set Alt-1 to copy Func Copy1(); Alt-1 Hotkey function Send("^c") $cb = ClipGet();gets data from clibbord IniWrite(@scriptdir & "\bord.ini", "bord", "1", $cb);saves it to a file EndFunc HotKeySet('!2', 'Copy2'); Set Alt-2 to copy Func Copy2(); Alt-2 Hotkey function Send("^c") $cb = ClipGet();gets data from clibbord IniWrite(@scriptdir & "\bord.ini", "bord", "2", $cb);saves it to a file EndFunc $idle = 0 Do Sleep ( 100 ) Until $idle = 10but this will not copy the marked text i relly dont understand why, ctrl + c is send right?i did also try to use Opt("SendKeyDownDelay", 500) dident seam to helpEdit:im rather stuck for now, just cant think of a way to push ctrl c, remember that the script dose not need to mark the text, im marking the text to copy and pressing the Hotkey that will copy/save the text in a file for later use... either i need a function or script to copy marked text, or a function or script that will press ctrl+c and that way copy the text i marked..... Edited December 15, 2004 by HARNOvHARNO
HARNOvHARNO Posted December 15, 2004 Author Posted December 15, 2004 (edited) i do not understand this... i tryed to rename a file and then hit alt + 1 and another file alt + 2 it did save the file names in my file. i was happy as it worked. [bord] 1=filename1 2=filename2 but when im marking text in firefox or notepad it just seys a windows "ding" sound and wont copy the text i marked why is this? im doing a - Send ("^c") so wouldent it be the same as pressing ctrl + c? why cant i copy marked text in firefox or notepad with Send ("^c") ? Edited December 15, 2004 by HARNOvHARNO
sykes Posted December 15, 2004 Posted December 15, 2004 Send("{CTRLDOWN}") ;Holds the CTRL key down until {CTRLUP} is sentSend("{c down}") ;Holds the c key down until {c up} is sentSend{CTRLUP} ;Releases the Ctrl keySend{c up} ;Releases the c key<{POST_SNAPBACK}>Send{CTRLUP} Should be Send("{CTRLUP}")andSend{c up} should be Send("{c up}") We have enough youth. How about a fountain of SMART?
HARNOvHARNO Posted December 15, 2004 Author Posted December 15, 2004 (edited) Send{CTRLUP} Should be Send("{CTRLUP}")andSend{c up} should be Send("{c up}")<{POST_SNAPBACK}>i could not get the other code to work so im trying "Send ("^c")" right now. so far i can only get it to work at file names. it wont copy marked text from other windows.when hitting alt+1 at marked text in firefox or notepad it just seys a enoring ding sound.edit: somhow its the alt key, when only useing "1" as Hotkey there are no problems.meybe alt+1 is in use by windows so im just trying some other hotkeys. thank you for trying to help me :-) Edited December 15, 2004 by HARNOvHARNO
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