toolauto Posted June 3, 2012 Share Posted June 3, 2012 Hello everyone I'm creat a autoit file, i want to auto copy to clipboard when i select them after 5 or 10 sec, it will automatic paste where my mouse click i used this code, but it not work #include <GuiConstants.au3> Dim $Start HotKeySet("{F8}","Pause") HotKeySet("{F9}","Start") While 1 Sleep(50) WEnd Func Start() $Start = NOT $Start If $Start Then ToolTip('Press (F8) to Pause',0,0) $start = TimerInit() While $Start If TimerDiff($start) > 2000 Then Send("{ENTER}") Sleep(50) Send("^v") Sleep(50) Send("{ENTER}") $start = TimerInit() EndIf WEnd ToolTip("") EndFunc Func Pause() ToolTip('Press (F9) to Start',0,0) While 1 Sleep(50) WEnd EndFunc Please help me Link to comment Share on other sites More sharing options...
Kidney Posted June 4, 2012 Share Posted June 4, 2012 Declare $Start as False before the function. I would also change the While $Start to: While $Start = True And it also will only send the clipboard to wherever you click, not where your mouse is hovering at. A safer way to send the clipboard is to do: Send(clipget()) Link to comment Share on other sites More sharing options...
toolauto Posted June 4, 2012 Author Share Posted June 4, 2012 i think this code is fail i want to auto copy to clipboard when i select them it will automatic paste where my mouse click after that Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 4, 2012 Share Posted June 4, 2012 These functions - ControlCommand (hint: with GetSelected parameter), and _IsPressed, and ClipPut, may be useful here. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
toolauto Posted June 4, 2012 Author Share Posted June 4, 2012 i can not start from anything Please help me somdcomputerguy Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 4, 2012 Share Posted June 4, 2012 Please help me somdcomputerguyWell OK, but don't hold your breath waiting. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
czardas Posted June 4, 2012 Share Posted June 4, 2012 What somdcomputerguy is saying is make an effort to use these functions. If you are not sure where to start run the examples in the help file and then try and figure out how you might adapt the examples to suit your needs. If you get stuck then post your efforts. Also, without knowing the control you wish to copy from it is tricky to know what would be the best solution. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Mechaflash Posted June 4, 2012 Share Posted June 4, 2012 What somdcomputerguy is saying is make an effort to use these functions. If you are not sure where to start run the examples in the help file and then try and figure out how you might adapt the examples to suit your needs. If you get stuck then post your efforts. Also, without knowing the control you wish to copy from it is tricky to know what would be the best solution.or before Mechaflash creates some obfuscated code for you XD Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 4, 2012 Share Posted June 4, 2012 (edited) Ya, that is partially what I meant. It usually takes me quite a while to come up with actual working code. Also, as czardas said, it'd be kinda tough to come up with something that would work for you since nobody (maybe even you!) knows just what you want. But try this code. Some notes first though:1. Select the appropriate text and use CTRL-C to copy it. I ran into some complications with ControlCommand. That function would be fine using CTRL-A to select, but a click-drag or Shift-Arrow doesn't work out, as only one character at a time is selected..2. Use ALT-TAB to switch to the app you want to paste into. Don't click! Once you copy, the next click will start the paste.#include <Misc.au3> Opt("SendKeyDelay", 50) $dll = DllOpen("user32.dll") ClipPut("") While 1 ToolTip(" Copy Something ") If ClipGet() <> "" Then ExitLoop Sleep(10) WEnd While 1 ToolTip(" Click to paste ") If _IsPressed("01", $dll) Then ToolTip("") Send(ClipGet()) Exit EndIf Sleep(10) WEndThis should get you started, and you can click on a function in the code above to load the online doc's page. F1 in SciTE does the same (though with the local help file). Edited June 4, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
toolauto Posted June 4, 2012 Author Share Posted June 4, 2012 Thanks somdcomputerguy Could you edit how to auto copy something and don't work 1 time, work longer time .... Thanks again Link to comment Share on other sites More sharing options...
toolauto Posted June 4, 2012 Author Share Posted June 4, 2012 can that code be edited with hotkeyset : copy function to left mouse ? paste the clipboard with next click ? Anything idea ? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 4, 2012 Moderators Share Posted June 4, 2012 Hi, toolauto, here's an idea - TRY IT Take what somdcomputerguy has generously given you, and try it out with the functions you're asking about. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
toolauto Posted June 4, 2012 Author Share Posted June 4, 2012 Hi, toolauto, here's an idea - TRY IT Take what somdcomputerguy has generously given you, and try it out with the functions you're asking about. i've tried till now. but i can not fix this code ( Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 4, 2012 Share Posted June 4, 2012 Showing what you've tried will go a lot further than saying that you've tried. The only editing I would do to that snippet above would be to add comments. Maybe I should've done that in the first place, but the code as it is shouldn't be hard to follow.Read thru the Help file once or twice or a hundred times. Especially the first few sections - Using AutoIt, Tutorials, and Language Reference. There's some other very helpful tutorials here, just search on that word - tutorial.I hope you don't take this except as how I mean it - sincerely. toolauto 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
toolauto Posted June 5, 2012 Author Share Posted June 5, 2012 I will try more and i will comeback . okay Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 5, 2012 Share Posted June 5, 2012 The Forum and this great community will be here. toolauto 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
toolauto Posted June 5, 2012 Author Share Posted June 5, 2012 ( i can't edit ( everything's error . i don't know how to repeat that funtion again and again...... how must i do now ? I've tried my best Link to comment Share on other sites More sharing options...
Mechaflash Posted June 5, 2012 Share Posted June 5, 2012 Post your code and any errors. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
toolauto Posted June 5, 2012 Author Share Posted June 5, 2012 #include <Misc.au3> Opt("SendKeyDelay", 50) $dll = DllOpen("user32.dll") ClipPut("") While 1 ToolTip(" Copy Something ") If ClipGet() <> "" Then ExitLoop Sleep(10) WEnd While 1 ToolTip(" Click to paste ") If _IsPressed("01", $dll) Then ToolTip("") Send(ClipGet()) Exit EndIf Sleep(10) WEnd i used somdcomputerguy but i don't know how to repeat copy , paste again and again thanks all Link to comment Share on other sites More sharing options...
Mechaflash Posted June 5, 2012 Share Posted June 5, 2012 #include <Misc.au3> Opt("SendKeyDelay", 50) $dll = DllOpen("user32.dll") ClipPut("") While 1 ToolTip(" Copy Something ") If ClipGet() <> "" Then ExitLoop Sleep(10) WEnd While 1 ToolTip(" Click to paste ") If _IsPressed("01", $dll) Then ToolTip("") Send(ClipGet()) Exit EndIf Sleep(10) WEnd This should get you started, and you can click on a function in the code above to load the online doc's page. F1 in SciTE does the same (though with the local help file). #include <Misc.au3> Opt("SendKeyDelay", 50) $dll = DllOpen("user32.dll") ClipPut("") While 1 ToolTip(" Copy Something ") If ClipGet() <> "" Then ExitLoop Sleep(10) WEnd While 1 ToolTip(" Click to paste ") If _IsPressed("01", $dll) Then ToolTip("") Send(ClipGet()) Exit EndIf Sleep(10) WEnd i used somdcomputerguy but i don't know how to repeat copy , paste again and again thanks all You posted exactly what somdcomputerguy gave you for a starting point. Edit your code to do what you need, if it doesn't work, post what you've done here with any errors. Laziness is unacceptable... i mean... you're already sitting on your butt not doing physical labor. How much more laziness do you need? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” 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