Estimize Posted August 6, 2016 Posted August 6, 2016 (edited) The code below is intended to copy and paste highlighted text but I've been running into trouble. The Text is already highlighted via the Mouseclicks and I've tried selecting text myself and then running code but I've no such luck. The issue is with the send("^C") part of the code I believe because ClipGet() works when I manually copy something. Any help is appreciated. #include <Array.au3> #include <MsgBoxConstants.au3> Sleep(1000) MouseClick("left",1162, 497,2,1) send("^C") sleep(2000) $Time = ClipGet() MsgBox(1,"",$Time,0) Update : I've just ran Send("^c") on its own in blank page in autoit to see what it entered and the photo below shows just that. Edited August 6, 2016 by Estimize
l3ill Posted August 6, 2016 Posted August 6, 2016 (edited) Try using a small c send("^c") Edited August 6, 2016 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
SadBunny Posted August 6, 2016 Posted August 6, 2016 Doesn't the mouseclick cancel the selection? Roses are FF0000, violets are 0000FF... All my base are belong to you.
l3ill Posted August 6, 2016 Posted August 6, 2016 Looks like the code is double clicking the text which would highlight it... My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Estimize Posted August 6, 2016 Author Posted August 6, 2016 3 minutes ago, SadBunny said: Doesn't the mouseclick cancel the selection? They aren't the problem , I've tried it with and without the mouseclicks and it still doesnt work.
l3ill Posted August 6, 2016 Posted August 6, 2016 I just tested your code several times doublelcick on sleep and then run this code: ;~ Sleep(1000) ;~ MouseClick("left",1162, 497,2,1) send("^c") sleep(2000) $Time = ClipGet() MsgBox(1,"",$Time,0) I get a message box with "sleep" My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Estimize Posted August 6, 2016 Author Posted August 6, 2016 6 minutes ago, l3ill said: Try using a small c send("^c") Just tried and it worked, thank you, this just makes me confused as to why it works with a small c and not a capital C now, any ideas?
SadBunny Posted August 6, 2016 Posted August 6, 2016 Good point, I missed that 2 there I was going to suggest lowercase c as well, but i tested it in notepad and there it works fine with ^C. @Estimize Where are you copying from? Is it a default windows control or maybe some special gui? Try playing with SendKeyDownDelay by setting Opt("SendKeyDownDelay", 50) (or higher values) on top of your script, some interfaces need more time to register the keypress than the default 5 msec. Roses are FF0000, violets are 0000FF... All my base are belong to you.
l3ill Posted August 6, 2016 Posted August 6, 2016 A capital C would need the shift key to be pressed, just not the way autoit works My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
SadBunny Posted August 6, 2016 Posted August 6, 2016 The capital C implies pressing the shift key. From the Send() help file: Quote N.B. Some programs are very choosy about capital letters and ALT keys, i.e., "!A" is different from "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase! Roses are FF0000, violets are 0000FF... All my base are belong to you.
l3ill Posted August 6, 2016 Posted August 6, 2016 (edited) I hear an echo... Edited August 6, 2016 by l3ill SadBunny 1 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
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