AutoHotkey Community

It is currently May 27th, 2012, 10:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: September 15th, 2006, 1:56 pm 
Offline

Joined: May 22nd, 2006, 2:01 pm
Posts: 25
Hello,

anybody has an idea why this doen't work?

Code:
loop
{
clipboard =
a = x´r´n
b =

send, ^{down}
send, ^c
clipwait, 3

if clipboard = %a%
{
send, ^{up}
send, {down}
break
}

else if clipboard = %b%
{
send, ^{up}
send, ^{up}
send, {down}
break
}
}

return

AHK doesn't recognize when it finds a empty cell!

Thanks a lot

Oli


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2006, 2:51 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
I use this snippet to test cells in one of my scripts, It will have to be modif ied...

Code:
ClipBoard := ;
SendInput, {CTRLDOWN}c{CTRLUP}
ClipWait
Var2 := Clipboard
SendInput, {ESC}
StringSplit, Var2_, Var2, `n, %A_Space% %A_Tab% `n
Length := StrLen(Var2_1)
IfLessOrEqual, Length, 2
 {
 ; Selected Cell is blank (except for [b]`n[/b]) (in my situation)
 ; So do stuff
 }
Else
 {
 ; Not blank, Do other Stuff
 }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2006, 7:05 pm 
Offline

Joined: December 30th, 2005, 5:01 pm
Posts: 448
I guess you use variable b for checking on an empty cell? No, that doesn't work 8) . An empty cell contains either `n or `r, or both (I'm not sure what, but it's not an empty string).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2006, 7:32 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Quote:
Code:
IfLessOrEqual, Length, 2
 {
 ; Selected Cell is blank (except for `n) (in my situation)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2006, 9:50 pm 
Offline

Joined: December 30th, 2005, 5:01 pm
Posts: 448
@ahklerner: Sorry, you are right. I just quickly looked at the post, but you gave the solution in your post already :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2006, 6:07 am 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 355
Location: Germany
Hello

for my test with Excel 2003 I changed:

Code:
a = x`r`n
b = `r`n


and then it works (look for the red color in both lines)

Hubert


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2006, 9:34 am 
Probably it was more a clipboard problem than an Excel one, as each text line in the clipboard ends with `r`n, which is not necessary the case for excel (I'm quite sure it isn't).


Report this post
Top
  
Reply with quote  
 Post subject: That´s it!
PostPosted: September 18th, 2006, 9:53 am 
Offline

Joined: May 22nd, 2006, 2:01 pm
Posts: 25
Thanks a lot!

The Problem was that I used the "`" in the wrong way!

Regards

Oli


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Maestr0 and 58 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