AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

variable problems in first run

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ste
Guest





PostPosted: Tue May 23, 2006 1:46 pm    Post subject: variable problems in first run Reply with quote

Hi there,
I work with autohotkey to dump excel infos to a web based database. I'm doing this with an automated copy & paste
Send, {CTRLDOWN}c{CTRLUP}
variable := clipboard
...

The strange thing is: Almost anytime when I use the tool for the first time of a day, assigning the "copy"-value to the variable doesn't seem to work. Or there's often any value in the variable, which I copied before using the tool. When I exist the script and start it again, it always works. Any proposals??
cheers, ste
Back to top
Greg



Joined: 22 Dec 2005
Posts: 246

PostPosted: Tue May 23, 2006 1:57 pm    Post subject: Reply with quote

At the start of the script add:

Code:
Clipboard =
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue May 23, 2006 2:04 pm    Post subject: Reply with quote

As you wrote, it is strange...
Do you have a clipboard manager? Doesn't latest Office versions manage the clipboard themselves?
Anyway, you can start by clearing the clipboard before starting the copy: Clipboard =
Perhaps check if the clipboard is empty or not after sending the Ctrl+C.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
ste
Guest





PostPosted: Tue May 23, 2006 2:18 pm    Post subject: Reply with quote

Ok, I'll try it with Clipboard =
but it may also be related with this Office clipboard manager (I don't trust it, even if it's deactivated). Thanks for you replies. I'll be back...
Back to top
evl



Joined: 24 Aug 2005
Posts: 1239

PostPosted: Tue May 23, 2006 2:37 pm    Post subject: Reply with quote

You could try adding a delay for the initial case, like:
Code:
If Var =
Sleep, 50


As I recall the microsoft clipboard thing is rather slow to pop up on first use, so it could be the cause if it's still semi-active.
Back to top
View user's profile Send private message
Rabiator



Joined: 17 Apr 2005
Posts: 271
Location: Sauerland

PostPosted: Tue May 23, 2006 2:45 pm    Post subject: Reply with quote

Did you try
Code:
Send, ^c
variable := clipboard
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group