Sign in to follow this  
Followers 0
Newbie2

ClipPut issues

7 posts in this topic

#1 ·  Posted (edited)

Hi guys,

I must be doing something very wrong. Im trying to scan an excell file (which is open). What's wrong in this?

Send ("^c")
$x=clipget ()
msgbox (0,"",$x); It displayes 5
If $x = "5" Then
msgbox (0,"","OK"); Never arrived here! WHYYYYY?
EndIf
Edited by Newbie2

Share this post


Link to post
Share on other sites



Hi guys,

I must be doing something very wrong. Im trying to scan an excell file (which is open). What's wrong in this?

Send ("^c")
$x=clipget ()
msgbox (0,"",$x); It displayes 5
If $x = "5" Then
msgbox (0,"","OK"); Never arrived here! WHYYYYY?
EndIf

<{POST_SNAPBACK}>

Didn't test it but could it be that the $x var contains leading or trailing spaces ??

Try $x=StringStripWS(clipget (),3) and see if that works...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Bingo!! :(

I wonder why a simple excel cell contains leading or trailing spaces... :ph34r:

Share this post


Link to post
Share on other sites

hey the code works just fine... did you remmber that you have to highlight the stuff before it can be put on the clipboard?


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Yes, Beerman,

I have highlighted it before running the script. However, w/o Jdeb's fix, it doesn't work...

Share this post


Link to post
Share on other sites

well what i think you are doing is this

highlighting text executing script and not putting a delay on the script or calling attention back to the window.... you have to do that, before it knows what to copy....do this. put a sleep delay on your script, like 30 seconds or something. highlight what you want then wait.... see if that works... you have to remmber to draw windows attention back to the window you want the text copied from.


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Delay is not the problem.

I have put the delay needed, but it's not submitted in the piece of script I have submitted.

The probelm is that excel adds some spaces so If $x = "5" Then... will never be true unless you strip out the spaces by using Jdeb's fix.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0