AutoHotkey Community

It is currently May 26th, 2012, 11:41 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 7th, 2009, 12:41 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 1:19 pm 
Offline

Joined: May 12th, 2009, 2:37 pm
Posts: 640
Location: Gloucester UK
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: I tried this and ...
PostPosted: November 7th, 2009, 2:08 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 4:42 pm 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 6:57 pm 
Try

Send, {CtrlDown}c{CtrlUp}

instead of ^c?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Leef_me, Pulover, rbrtryn, XstatyK, Yahoo [Bot] and 36 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group