Jump to content

Intermittent Clipput Issue


Recommended Posts

Howdy-

I have a autoit script that sits and watches an email box for new email, then "reads" the email into variables for inclusion later into automatically generated problem tickets.

It works great, typically, but about 10-20% of the time it doesn't retrieve the data back from the variable I stored the clipboard info, (using clipget), and I have to reset it so it'll try again. Typically it works on the next try with no issues.

My questions are:

a) Has anyone else experienced this?

B) Do they have a workaround they'd like to share. :)

I've considered inserting a loop to have it check the size of the clipboard after the clipput and retry upon failure, but this seems a little ridiculous.

Any assistance would be wonderful!

-Crim

Edited by Mr. Crimson
Link to comment
Share on other sites

Howdy-

I have a autoit script that sits and watches an email box for new email, then "reads" the email into variables for inclusion later into automatically generated problem tickets.

It works great, typically, but about 10-20% of the time it doesn't retrieve the data back from the variable I stored the clipboard info, (using clipget), and I have to reset it so it'll try again.  Typically it works on the next try with no issues.

My questions are:

a)  Has anyone else experienced this?

:whistle:  Do they have a workaround they'd like to share. :dance:

I've considered inserting a loop to have it check the size of the clipboard after the clipput and retry upon failure, but this seems a little ridiculous.

Any assistance would be wonderful!

-Crim

<{POST_SNAPBACK}>

could you include some code for us to help troubleshoot? if you have your script log into your mail account or whatever, make sure that you don't include that part, we (hopefully i speak for everyone on this) don't want your email login and password...
Link to comment
Share on other sites

(Sorry about misposting in the bug forum... I meant to post it in Support, guess I got distracted.)

Well, it's getting a little bit big, but here it is.

I haven't really had time to tidy up things, so there's bound to be potential oddities.

Let me know what you think-

Crim

AutoItSetOption("TrayIconDebug", 1)
AutoItSetOption("WinTitleMatchMode", 2)
AutoItSetOption("MouseCoordMode", 1)
AutoItSetOption("SendKeyDelay", 50)
#include <GUIConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <process.au3>

; Initiate GUI
GUICreate("Correodanza 1.0", 175,95)
$label_title = GUICtrlCreateLabel ("Correodanza 1.0",  12, 5, 150, 20)
$button_1 = GUICtrlCreateButton ("Start", 12, 65, 50, 20)
$label_title2 = GUICtrlCreateLabel ("Current Status",  12, 25, 160, 20)
$label_status_1 = GUICtrlCreateLabel ("", 12, 45, 160, 20)
;$button_2 = GUICtrlCreateButton ("Stop", 120, 50, 50, 20)

; Setup variables
DIM $statusbardata
DIM $astatusbardata[5]
DIM $emaildata
DIM $aemaildata[8]
DIM $amsgwindow[2]
DIM $msgbody
DIM $msgsubject
DIM $racfofsender
DIM $msgtitle
DIM $stop
DIM $attachment1
DIM $attachname
DIM $isattachment
DIM $keepalivecount
DIM $tickcat_subcat
DIM $tickgroup

; Create Global HotKey variables to pause/exit script.
; Press Esc to "exit" the script, Pause/Break to "pause"
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Correodanza is currently "Paused", press "Pause/Break" to continue again or "ESC" to exit',0,0)
        $label_status_1 = GUICtrlCreateLabel ("Script is paused...",  12, 45, 160, 20)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

; Main Email Parser
Func _OutlookMon ()
$keepalivecount = 0
$stop="No"
    While 1
; Pause 1 second between each loop
    Sleep(1000)
; Roughly every minute, do a update on the counts.
    $keepalivecount = $keepalivecount + 1
    If $keepalivecount > 59 Then
        If WinExists ("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe") = 1 Then
            WinActivate("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
            Send("!a")
            $keepalivecount = 0
        EndIf
    EndIf
; Timetable trap
; (Check time and day of week to close USD and pause script until timetable says to start up USD and begin again.)
    While @HOUR < 7 Or @HOUR > 17 Or @WDAY = 1 Or @WDAY = 7
        If WinExists ("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe") = 1 Then
            WinActivate("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
            Send("!ue")
            WinWait("Unicenter ServicePlus Service Desk - Login", "http://usdp/CAisd/pdmweb.exe")
            Sleep(1000)
            Send("!{F4}")
        EndIf
        ToolTip('Correodanza is currently in afterhours mode and/or USD is not running, press "Pause/Break" to pause or "ESC" to exit',0,0)
        Sleep(1000)
    Wend
; /Timetable trap

    If WinExists("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe") = 0 Then
        Run(@ComSpec & ' /c call c:\progra~1\intern~1\iexplore.exe [url=http://usdp/CAisd/pdmweb.exe']http://usdp/CAisd/pdmweb.exe'[/url], "", @SW_HIDE)
        WinWait("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
        ToolTip('Correodanza is currently attempting to log into USD, press "Pause/Break" to pause or "ESC" to exit',0,0)
        WinActivate("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
        Sleep(5000)
        Send("loginid{TAB}password{ENTER}")
        WinWait("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
    EndIf

        ToolTip('Correodanza is currently running, press "Pause/Break" to pause or "ESC" to exit',0,0)
    $label_status_1 = GUICtrlCreateLabel ("Waiting for new email to arrive...",  12, 45, 160, 20)
    ; Begin Gathering Outlook data
        If WinExists("eLynx - Microsoft Outlook") Then
        Winactivate("eLynx - Microsoft Outlook")
        $statusbardata = StatusBarGetText("eLynx - Microsoft Outlook", "", 1)
            If StringInStr($statusbardata, ",")>0 Then
        ; Gets the number of unread emails
            $unreademails = StringTrimRight(StringMid($statusbardata, StringInStr($statusbardata, ",")+2), 7)

;            For $i = 1 to $unreademails Step 1
            $label_status_1 = GUICtrlCreateLabel ("Processing new email...",  12, 45, 160, 20)
            ToolTip('Correodanza is currently reading email, press "Pause/Break" to pause or "ESC" to exit',0,0)
            For $i = 1 to 1 Step 1
                ToolTip('Correodanza is currently running, press "Pause/Break" to pause or "ESC" to exit',0,0)
                ClipPut("")
                Winactivate("eLynx - Microsoft Outlook")
                Send("{UP}^c")
                $emaildata = ""
                Winactivate("eLynx - Microsoft Outlook")
                $emaildata = ClipGet()
                $emaildata = StringTrimLeft ( $emaildata, 29 )
                $emaildata = StringTrimRight ( $emaildata, 1 )
                $aemaildata = StringSplit($emaildata, @TAB)
                Send("{ENTER}")
                Sleep(2000)
                Send("^a")
                Sleep(250)
                Send("^c")
                Sleep(250)
                Send("!{F4}")
                Run("Notepad.exe")
                WinWait("Untitled", "")
                Sleep(250)
                Send("^v^a^c!{F4}")
                Sleep(250)
                Send("n")
                $msgbody = ClipGet(); Apparantly it doesn't handle email text well so this had to go through the Notepad first to strip out any special formatting.
            ; Double Mouse Click at 569,62 of Outlook window
                Dim $primary
                Dim $secondary
            ; Determine if user has swapped right and left mouse buttons
                $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

                ; It's okay to NOT check the success of the RegRead operation
                    If $k = 1 Then
                    $primary = "right"
                    $secondary = "left"
                    Else;normal (also case if could not read registry key)
                    $primary = "left"
                    $secondary = "right"
                    EndIf
                $amsgwindow = WinGetPos ("eLynx - Microsoft Outlook")
                Winactivate("eLynx - Microsoft Outlook")
                MouseClick($primary, $amsgwindow[0]+569, $amsgwindow[1]+62, 1)
                Sleep(250)

            ; Is user in Outlook phone book?
                Send($aemaildata[1] & "{ENTER}")
                $proptimeout = 1
                $proptimeout = WinWait($aemaildata[1] & " Properties","", 2)
                    If $proptimeout = 0 Then
                    Send("!{F4}")
                    _ArrayInsert($aemaildata,6, $aemaildata[1])
                    $aemaildata[5]=StringReplace($aemaildata[1],",","-")
                    Winactivate("eLynx - Microsoft Outlook")
                    Else
                    Send("{TAB 4}^c{ENTER}")
                    _ArrayInsert($aemaildata,6, ClipGet())
                        IF StringLen($aemaildata[5])=0 Then
                        $aemaildata[5]=StringReplace($aemaildata[1],",","-")
                        $proptimeout = 0
                        Endif
                    EndIf

            ; Is there an attachment?
                $amsgwindow = WinGetPos ("eLynx - Microsoft Outlook")
                Winactivate("eLynx - Microsoft Outlook")
            ; Requires Save Attachments be added to the toolbar separately below the standard one
                Winactivate("eLynx - Microsoft Outlook")
                MouseClick($primary, $amsgwindow[0]+109, $amsgwindow[1]+87, 1)
                MouseClick($primary, $amsgwindow[0]+109, $amsgwindow[1]+97, 1)
                $isattachment = 0
                $isattachment = WinWait("Save Attachment","CSnakeList", 2)
                    If $isattachment = 0 Then
                    _ArrayInsert($aemaildata, 7, "No Attachment")
                    Else
                    Send("^a^c")
                    $attachname = Clipget()
;                _arraydisplay ($aemaildata,"Test"); Just a test to see what's in there...
                    $attachment1 = "C:\CORRATTDATA\" & $aemaildata[5] & "-" & $attachname
                    Send($attachment1 & "{ENTER}")
                    Sleep(1000)
                        If WinExists("Microsoft Outlook", "already exists") Then
                        Send("!y")
                        Sleep(2000)
                        _ArrayInsert($aemaildata, 7, $attachment1)
                        EndIf
                    EndIf
    ; End of Outlook Data Gathering

    ; Beginning USD Ticket Creation
                ; If email address does not contain the Corr key code *Corr*, create ticket and dump it into Software - MortgageWare
                    $label_status_1 = GUICtrlCreateLabel ("Generating USD ticket for new email...",  12, 45, 160, 20)
                    ToolTip('Correodanza is currently creating USD Ticket, press "Pause/Break" to pause or "ESC" to exit',0,0)
                ; ** RESTRICTOR - Checks to see if email is an elynx email.  If so, it continues, otherwise, no ticket is generated.
                ; If StringInStr($aemaildata[2], "FW: Failed Package")>0 OR StringInStr($aemaildata[2], "FW: Failed Email")>0 OR StringInStr($aemaildata[2], "FW: Nondeliverable mail")>0 Then
                    
                ; Checks to see if email is formatted for Correodanza
                    $ticketwintitle = ""
                        If WinExists("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")Then
                            WinSetState("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe", @SW_RESTORE)
                            WinActivate ("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
                            WinWaitActive("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe")
                            Sleep(1000)
                            Send("!f")
                            Send("n")
                            WinWait("Create New Request")
                            WinActivate("Create New Request")
                            WinWaitActive("Create New Request", "", 5)
                            $ticketwintitle = WinGetTitle("")
                            WinWait($ticketwintitle)

                        ; Ticket Category Analyzer Section
                        ; Clear out the ticket cat/subcat variable
                            $tickcat_subcat = ""
                        ; See if email is standard and if so, assign category/subcat variable accordingly for input later.  If none found, use "generic" cat/subcat
                            Select
                                Case StringInStr($msgbody, "ENTRE_AUTONUMBERS")>0
                                    $tickcat_subcat = "ENTRE.AUTONUMBER"
                                    $tickgroup = "CBD-Mortgage SE HelpDesk - 2nd Level"
                                Case StringInStr($msgbody, "MORTGAGEWARE_AUTONUMBERS")>0
                                    $tickcat_subcat = "MORTGAGEWARE.AUTONUMBER"
                                    $tickgroup = "CBD-Mortgage SE HelpDesk - 2nd Level"
                            ; Commented out because ENTRE.DROP doesn't exist in USD yet.
                            ; Case StringInStr($msgbody, "Entre Database")>0 AND StringInStr($msgbody, "ready")>0
                            ;    $tickcat_subcat = "ENTRE.DROP"
                                Case StringInStr($msgbody, "www.elynx.com")>0
                                    $tickcat_subcat = "ELYNX.MISSING_INFO"
                                    $tickgroup = "CBD-Mortgage SE HelpDesk - 1st Level"
                            EndSelect
                        ; If no category was assigned, assign, "MORTGAGE LOAN" category to ticket.
                            If StringLen($tickcat_subcat)=0 Then
                                $tickcat_subcat = "MORTGAGE LOAN"
                            EndIf
                            If StringLen($tickgroup)=0 Then
                                $tickgroup = "CBD-Mortgage SE HelpDesk - 1st Level"
                            EndIf
                        ; /Ticket Category Analyzer Section
                            $msgbody = StringLeft($msgbody, 3950)
                            ClipPut($msgbody)
                        ; Was the sender in the Outlook phonebook?  If so, insert the sender RACF in the array as the assignee, otherwise, insert generic name.
                            If $proptimeout = 0 Then
                                Sleep(1000)
                                Send($tickcat_subcat)
                                WinActivate($ticketwintitle)
                                WinWaitActive($ticketwintitle)
                                Sleep(500)
                                Send("{TAB 10}^v")
                                Sleep(100)
                                $amsgwindow = WinGetPos ($ticketwintitle)
                            Else
                        ; RACFID of sender, if available is: $aemaildata[5]
                            ; Gets the assignee based upon the RACF included in the formatted subject line.

                                If WinExists ($ticketwintitle) AND StringLen($aemaildata[5]) > 0 Then
                                ; Code For Entering User name
                                ; Double Mouse Click in active window
                                    Dim $primary
                                    Dim $secondary
                                ; Determine if user has swapped right and left mouse buttons
                                     $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

                                ; It's okay to NOT check the success of the RegRead operation
                                    If $k = 1 Then
                                        $primary = "right"
                                        $secondary = "left"
                                    Else;normal (also case if could not read registry key)
                                        $primary = "left"
                                        $secondary = "right"
                                    EndIf
                                    If WinExists ($ticketwintitle) Then
                                        BlockInput(1)
                                        $arequestwin = WinGetPos ($ticketwintitle)
                                        WinActivate ($ticketwintitle)
                                        WinWaitActive($ticketwintitle)
                                        Sleep(150)
                                        ; Pixel Checker
                                        If PixelGetColor($arequestwin[0]+600, $arequestwin[1]+210)="16776960" Then
                                            MouseClick($primary, $arequestwin[0]+142, $arequestwin[1]+237, 1)
                                        Else
                                            MouseClick($primary, $arequestwin[0]+142, $arequestwin[1]+217, 1)
                                        EndIf
                                        BlockInput(0)
                                    ; MouseClick($primary, $arequestwin[0]+142, $arequestwin[1]+217, 1)
                                    ; Searches for window
                                        WinWait("Contact Search - ", "", 5)
                                        If WinExists ("Contact Search - ") Then
                                            WinActivate ("Contact Search - ")
                                            Sleep(250)
                                            ClipPut(StringLower($aemaildata[5]))
                                            Send ("{TAB 6}")
                                            Sleep(100)
                                            Send("^v{ENTER}")
                                            WinWait ("Contact List - ", "", 5)
                                            WinActivate ("Contact List - ")
                                            Send("{ENTER}")
                                            WinWaitClose("Contact List - ", "", 5)
                                            BlockInput(0)
                                        EndIf
                                    EndIf
                                ; Checks to make sure user was found
                                    DIM $getclippy
                                    $saveclippy = ClipGet()
                                    Send("^a^c")
                                    $getclippy = ClipGet()
                                    If StringLen($getclippy)=0 Then
                                        Sleep(500)
                                        Send("^a^c")
                                        $getclippy = ClipGet()
                                    EndIf
                                    If StringLen($getclippy)=0 Then
                                        Sleep(500)
                                        Send("^a^c")
                                        $getclippy = ClipGet()
                                    EndIf
                                    If StringLen($getclippy)=0 Then
                                        Send("Loedding, Rebecca L.")
                                        Sleep(1000)
                                    EndIf
                                EndIf
                            ; Sends Ticket Info for cat and group based upon email info.
                                Send("{TAB 2}Customer Service.Service Request{TAB}" & $tickcat_subcat & "{TAB}3{TAB 2}3{TAB 2}" & $tickgroup)
                                WinActivate($ticketwintitle)
                                WinWaitActive($ticketwintitle)
                                Sleep(500)
                                ClipPut($msgbody)
                                Send("{TAB 10}^v")
                                Sleep(100)
                                $amsgwindow = WinGetPos ($ticketwintitle)
                            EndIf
                            If WinExists ($ticketwintitle) Then
                                $aMouseloc = MouseGetPos ()
                                WinActivate ($ticketwintitle)
                                WinWaitActive($ticketwintitle,"",10)
                                Send("!t")
                                Sleep(100)
                                Send("l")
                                WinWait ("Create New Activity for Request", "", 5)
                                WinActivate ("Create New Activity for Request")
                                WinWaitActive ("Create New Activity for Request", "", 5)
                                Sleep(100)
                                Send("{TAB 3}104 - E-Mail Received Via Correodanza!a")
                            EndIf
                            Winactivate($ticketwintitle)
                            WinWaitActive($ticketwintitle, "", 10)
                            Sleep(1500)
                            $ticketrefnum = Stringleft(WinGetTitle(""),7)
                            Send("!s"); Comment this to turn off saving
                            WinWaitActive("Request Detail", "", 10)
                            Sleep(1500)
                            Send("!c")
                            #cs
                            $ticketsavefail = WinWait("Save Failed","attribute", 1)
                            If $ticketsavefail = 1 Then
                                Winactivate("eLynx - Microsoft Outlook")
                                WinWaitActive ("eLynx - Microsoft Outlook")
                                Sleep (500)
                                Send("!fwm")
                                WinWait("Untitled - Message (HTML)")
                                WinActivate("Untitled - Message (HTML)")
                                WinWaitActive ("Untitled - Message (HTML)")
                                Sleep (500)
                                Send("Myself{TAB 2}Correodanza Alert Message!{TAB}Help, I'm stuck! *506*" & @CR & @CR & "-The Correodanza!s")
                                SplashTextOn("Alert!!", "Please help me!  I got stuck, click on the OK button once you've saved the ticket.", -1, -1, -1, -1, 8, "")
                            ElseIf $proptimeout > 0 Then
                                Winactivate("eLynx - Microsoft Outlook")

              

Edited by Mr. Crimson
Link to comment
Share on other sites

wow i really asked for it when i asked for code to debug eh?

i'm still going over all of this, but a few things that jumped out at me...

1) you set hotkey to escape to exit, dont' really need to do taht because unless you explicitly tell it not to exit on escape

Opt("GUICloseOnESC",0)

then gui will automatically be closed on escape. not a big deal of course, may save you 4 lines of code (woohoo!)

the other thing i was going to ask, is have you though of using vba for part of this project? the reason that i ask, is because it looks like you're using outlook, and vba is part of outlook and handles alot of the data you are using pretty nicely. you could make a little script for outlook that executes when new mail is received, then call your script with command line parameters to have it create the ticket. still looking at your code, but i'm thinking that other than little optimizations, without being able to duplicate the issue (intermittent issue using systems that i know i don't have access to) there really isn't a whole lot anybody else can do. I'm going to see if i can't find any kind of a logic error just by following the flow of it, but you may end up getting stuck debugging this one on your own... if you want some help using VBA i can help you with that, or with the new com objects you should be able to do alot of the same stuff, but i haven't used COM much so i wouldn't be the best one to help you with that approach.

Link to comment
Share on other sites

LOL, yeah, that's why I kind of shyed away from posting it off the bat, but since you asked. hehe Of course this is one of my shorter scripts. I have one that goes about 5000 lines. Has this really crazy search utility built in. Anywho...

Thanks for the tip on the escape key, I didn't even realize you could do that Option. I learn something new every day.

I'd love to use some VBA, as it does interface quite nicely when you are using office products, but I'm not nearly as familiar with it and it takes me quite a bit more time to develop my tools with it.

Do you have any suggestions for me re: quick and dirty resources for VBA? I'm honestly not a programmer by trade, only by necessity, but I guess I can learn. :whistle: To me VBA hasn't been nearly as intuitive as AutoIt, which is a testament to it's developers to be certain.

I have a VBScript book, (The OReilly nutshell one), which has come in handy when I had to edit someone else's work because it stopped working after he left the company.

I really appreciate and thank you for your time!

Best-

Crim

wow i really asked for it when i asked for code to debug eh?

i'm still going over all of this, but a few things that jumped out at me...

1) you set hotkey to escape to exit, dont' really need to do taht because unless you explicitly tell it not to exit on escape

Opt("GUICloseOnESC",0)

then gui will automatically be closed on escape.  not a big deal of course, may save you 4 lines of code (woohoo!)

the other thing i was going to ask, is have you though of using vba for part of this project?  the reason that i ask, is because it looks like you're using outlook, and vba is part of outlook and handles alot of the data you are using pretty nicely.  you could make a little script for outlook that executes when new mail is received, then call your script with command line parameters to have it create the ticket.  still looking at your code, but i'm thinking that other than little optimizations, without being able to duplicate the issue (intermittent issue using systems that i know i don't have access to) there really isn't a whole lot anybody else can do.  I'm going to see if i can't find any kind of a logic error just by following the flow of it, but you may end up getting stuck debugging this one on your own... if you want some help using VBA i can help you with that, or with the new com objects you should be able to do alot of the same stuff, but i haven't used COM much so i wouldn't be the best one to help you with that approach.

<{POST_SNAPBACK}>

Link to comment
Share on other sites

LOL, yeah, that's why I kind of shyed away from posting it off the bat, but since you asked. hehe  Of course this is one of my shorter scripts.  I have one that goes about 5000 lines.  Has this really crazy search utility built in.  Anywho...

Thanks for the tip on the escape key, I didn't even realize you could do that Option.  I learn something new every day.

I'd love to use some VBA, as it does interface quite nicely when you are using office products, but I'm not nearly as familiar with it and it takes me quite a bit more time to develop my tools with it.

Do you have any suggestions for me re: quick and dirty resources for VBA?  I'm honestly not a programmer by trade, only by necessity, but I guess I can learn. :whistle:  To me VBA hasn't been nearly as intuitive as AutoIt, which is a testament to it's developers to be certain.

I have a VBScript book, (The OReilly nutshell one), which has come in handy when I had to edit someone else's work because it stopped working after he left the company.

I really appreciate and thank you for your time!

Best-

Crim

<{POST_SNAPBACK}>

well the thing is, it's not really the vbscript that will mess you up with vba (and your book would be good for that as far as syntax etc) what will get you is the object model. i bought a book (can't think of the name off hand) that i ahve at home because it was the only written resource i could find at the store on vba for outlook, only to find it horribly written (bad code in the examples, syntax errors, just bad stuff in general). there are a few sites with good stuff, i want to say outlookvba.com and there was another that i can't think of... i found them by googling for outlook vba... once i get home (i'm at work right now and don't have access to outlook here) i can whip you up some examples to do what you want to do though.
Link to comment
Share on other sites

One small thing that might be causing an issue is not having a delay after you first send ^c to copy. I have ran into problems when I did not have a short delay after copying before reading the clipboard, though I am still an AutoIt Newbie and it could have been something else....

Link to comment
Share on other sites

One small thing that might be causing an issue is not having a delay after you first send ^c to copy.  I have ran into problems when I did not have a short delay after copying before reading the clipboard, though I am still an AutoIt Newbie and it could have been something else....

<{POST_SNAPBACK}>

have definitely seen that one before...depending on the amount of data, adding a sleep() may be a good idea...
Link to comment
Share on other sites

So far so good. It made it through the last few hours of yesterday. We'll see if it continues today. I think this is a good solution. What causes this? Is it because the paste function actually gets interrupted if something happens too quickly behind it? It's weird, but I guess I can live with it. :whistle:

-Crim

Link to comment
Share on other sites

So far so good.  It made it through the last few hours of yesterday.  We'll see if it continues today.  I think this is a good solution.  What causes this?  Is it because the paste function actually gets interrupted if something happens too quickly behind it?  It's weird, but I guess I can live with it. :whistle:

-Crim

<{POST_SNAPBACK}>

actually it's because of the way you're copying. when you send control c, your script doesn't know what that does, it just sends the keys, and continues on about it's business. And sometimes, especially with larger amounts of data, your code can get to where it tries to access the clipboard before the information is completely to the clipboard. It's like telling someone else to fill up a box with stuff and then running right over and start unloading it. There's a chance they've done it fast enough that you're unloading a full box like you intend, but depending on how much stuff you want in it, you may be ready to unload it before they fill it. Ironically, i hate real world analogies like that in programming books.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...