Jump to content
Sign in to follow this  
Newbie2

ClipPut issues

Recommended Posts

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...


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...