Newbie2 0 Report post Posted September 7, 2004 (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 September 7, 2004 by Newbie2 Share this post Link to post Share on other sites
Jos 1,292 Report post Posted September 7, 2004 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 How to post scriptsource Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Newbie2 0 Report post Posted September 7, 2004 Bingo!! I wonder why a simple excel cell contains leading or trailing spaces... Share this post Link to post Share on other sites
Somerset 1,789 Report post Posted September 7, 2004 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 Madness is the first step to understanding... Share this post Link to post Share on other sites
Newbie2 0 Report post Posted September 7, 2004 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
Somerset 1,789 Report post Posted September 7, 2004 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 Madness is the first step to understanding... Share this post Link to post Share on other sites
Newbie2 0 Report post Posted September 7, 2004 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