| View previous topic :: View next topic |
| Author |
Message |
Asaf Guest
|
Posted: Sat Nov 07, 2009 11:41 am Post subject: Copy and paste isn't working for me ... |
|
|
Hi there
I am a newbie ,So I guess my problem is simple. all i want to do is copy a text and paste it. the thing is that it is not working for me unless the text i am trying to copy is lying on my IE explorer or firefox window ( copy from PDF & WORD doesn't work)
here is my script:
^+c::
{
Send, ^c
Sleep 50
run notepad.exe
Sleep 5000
Send, ^v
return
}
It seems the problem is with the copy command as the text isn't loaded to the clipboard (and to the notepad in consequence) .
I've tried to change the sleep time, well...
thanks for you help |
|
| Back to top |
|
 |
wooly_sammoth
Joined: 12 May 2009 Posts: 178 Location: Gloucester UK
|
Posted: Sat Nov 07, 2009 12:19 pm Post subject: |
|
|
Morning,
You could try replacing the Sleep command after th ^c with a ClipWait as this will specifically wait until the clipboard contains data rather than just pausing. |
|
| Back to top |
|
 |
Asaf Guest
|
Posted: Sat Nov 07, 2009 1:08 pm Post subject: I tried this and ... |
|
|
thanks.. but it doesn't solved
I 've read the manual for clipwait command, and runned the following scipt which I have copied from the manual. as befoe, it works only when I copy from the explorer or firefox window. otherwise I get the failing message
cherish any help
^+c::
clipboard = ; Empty the clipboard
Send, ^c
ClipWait, 2
if ErrorLevel
{
MsgBox, The attempt to copy text onto the clipboard failed.
return
}
MsgBox, clipboard = %clipboard%
return |
|
| Back to top |
|
 |
rtcvb32
Joined: 17 Feb 2008 Posts: 125
|
Posted: Sat Nov 07, 2009 3:42 pm Post subject: |
|
|
I tested the code you gave, it seems to work fine.
However as a side note, a while back when i was working on large quantities of text, 2 seconds may not have been enough. Try upping it to say 5-6 seconds, or even take the limit off.
By large quantities of text, i was meaning 300k+ for experimentation. I am not entirely sure why the delay was no longer enough. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Nov 07, 2009 5:57 pm Post subject: |
|
|
Try
Send, {CtrlDown}c{CtrlUp}
instead of ^c? |
|
| Back to top |
|
 |
|