tekhed Posted September 15, 2004 Posted September 15, 2004 New to scripting in general, so I haven't made sense of a way to loop the following script until clipboard = empty. expandcollapse popup; ; AutoIt Version: 3.0 ; Language: English ; Platform: WinXP ; Author: Michael Harrell ; Purpose: To automatically enter purchase order data, even if it is only cut-and-paste!;) ; activate excel window, make sure to start spreadsheet active cell on A1! $text = ClipGet () Do WinActivate("Microsoft Excel - AS400.xls") Send("{DOWN}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{ENTER}") WinWaitActive("CALL CMSM04 - Microsoft Internet Explorer") send("{ENTER}") Until $text = 1 The above code doesn't actually work, because the 'Do - Until' loop is not accurate. How would I get AutoIT to repeat the cut/paste instructions until it goes back into excel, tries to copy something, but copies nothing then quits? Thanks in advance, Mike
tekhed Posted September 15, 2004 Author Posted September 15, 2004 Crap, wrong place to post this, sorry... :">
tekhed Posted September 16, 2004 Author Posted September 16, 2004 Have tried a variety of functions (If/Then, While/Wend, the one you suggested), with no success. Is there maybe another way to accomplish what I'd set out to do, cut-and-paste until clipboard is empty? Thanks, Mike
ZeDMIN Posted September 17, 2004 Posted September 17, 2004 Try: While ClipGet()<>"" WinActivate("Microsoft Excel - AS400.xls") Send("{DOWN}^c") ... WinWaitActive("CALL CMSM04 - Microsoft Internet Explorer") send("{ENTER}") WEnd Maybe you can give more specific detail, WHY it does not work? (Does not compile, does not get out of loop, ...) Greetings, ZeD
tekhed Posted September 17, 2004 Author Posted September 17, 2004 Good point, sorry. It ignores the function itself, so it would simply run the entire script, ignore while/wend or do/until, and end.
the_lord_mephy Posted September 18, 2004 Posted September 18, 2004 Is this already fixed? lol wouldnt u do expandcollapse popup; ; AutoIt Version: 3.0 ; Language: English ; Platform: WinXP ; Author: Michael Harrell ; Purpose: To automatically enter purchase order data, even if it is only cut-and-paste!;) ; activate excel window, make sure to start spreadsheet active cell on A1! $text = ClipGet () Do WinActivate("Microsoft Excel - AS400.xls") Send("{DOWN}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{TAB}") WinActivate("Microsoft Excel - AS400.xls") Send("{RIGHT}^c") WinActivate("CALL CMSM04 - Microsoft Internet Explorer") send("^v{ENTER}") WinWaitActive("CALL CMSM04 - Microsoft Internet Explorer") send("{ENTER}") Until @error = 1 My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Somerset Posted September 18, 2004 Posted September 18, 2004 expandcollapse popup; ; AutoIt Version: 3.0 ; Language: English ; Platform: WinXP ; Author: Michael Harrell ; Purpose: To automatically enter purchase order data, even if it is only cut-and-paste!;) ; activate excel window, make sure to start spreadsheet active cell on A1! $text = ClipGet () Do Call("window2") Send("{DOWN}^c") Call("window1") send("^v{TAB 6}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{TAB 2}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{TAB}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{TAB 4}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{TAB 2}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{TAB}") Call("window2") Send("{RIGHT}^c") Call("window1") send("^v{ENTER}") WinWaitActive("CALL CMSM04 - Microsoft Internet Explorer") send("{ENTER}") Until @error = 1 Exit Func window1() WinActivate("CALL CMSM04 - Microsoft Internet Explorer") EndFunc Func window2() WinActivate("Microsoft Excel - AS400.xls") EndFunc i hope i cleaned up the code for ya... this way makes it less confusing. i seperated your winactive into function calls. al the sending of the tab key, you don't need to kee p going {tab}{tab}{tab}{tab}{tab} just do this instead, {tab 5} the space and the number after words tells the send to send that key 5 times in a row.
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