Newbie2 Posted September 7, 2004 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
Developers Jos Posted September 7, 2004 Developers 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... 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.
Newbie2 Posted September 7, 2004 Author Posted September 7, 2004 Bingo!! I wonder why a simple excel cell contains leading or trailing spaces...
Somerset Posted September 7, 2004 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?
Newbie2 Posted September 7, 2004 Author Posted September 7, 2004 Yes, Beerman, I have highlighted it before running the script. However, w/o Jdeb's fix, it doesn't work...
Somerset Posted September 7, 2004 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.
Newbie2 Posted September 7, 2004 Author 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now