Jump to content

CTRL&V failure rate ~ 1 in 15


Recommended Posts

I wrote a program to automate the tickets at the office. My problem is, I'm using ClipPut to make the process faster, and 1 in every 10 to 15 lines it pastes I just get a letter "v" or, I get what ever is in the users clipboard at that moment. The reason that is such a large issue is sometimes the program could need to put out 30 lines of text, and if the program throws bad text the user will have to 1 notice and 2 go reenter their parameters. I'll list my attempts in the code box.

Func SendFast($ClipVar)
    $UserClipBoard = ClipGet()
    ClipPut($ClipVar)
    Send("{CTRLDOWN}")
    Send("v")
    Send("{CTRLUP}")
    Send("{ENTER}")
    ClipPut($UserClipBoard)
EndFunc

Func SendFast($ClipVar)
    $UserClipBoard = ClipGet()
    ClipPut($ClipVar)
    Send("{CTRLDOWN}v")
    Send("{CTRLUP}")
    Send("{ENTER}")
    ClipPut($UserClipBoard)
EndFunc

Func SendFast($ClipVar)
    $UserClipBoard = ClipGet()
    ClipPut($ClipVar)
    Send("^v")
    Send("{ENTER}")
    ClipPut($UserClipBoard)
EndFunc 

Is there a more reliable way to send the paste command?
 

Edited by JayHawkfl

Thanks for your time

 

Link to comment
Share on other sites

Try sending shift + insert


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Func SendFast($ClipVar)
    $iSleep = 10
    $UserClipBoard = ClipGet()
    Do
        ClipPut($ClipVar)
    Until ClipGet() = $ClipVar
    Send("^v")
    Sleep($iSleep)
    Send("{ENTER}")
    Do
        ClipPut($UserClipBoard)
    Until ClipGet() = $UserClipBoard
EndFunc   ;==>SendFast

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Func SendFast($ClipVar)
    $iSleep = 10
    $UserClipBoard = ClipGet()
    Do
        ClipPut($ClipVar)
    Until ClipGet() = $ClipVar
    Send("^v")
    Sleep($iSleep)
    Send("{ENTER}")
    Do
        ClipPut($UserClipBoard)
    Until ClipGet() = $UserClipBoard
EndFunc   ;==>SendFast

 

I am not sure I understand this, but it has been a long day.

Are you just grabbing the clipboard to begin with, and then putting the clipped data back into the clipboard?

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Thanks, I have seen it fail in my scripts, so I just reran the hotkey, I will now add this bit to my code, so it will not fail next time - we hope.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

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