Sign in to follow this  
Followers 0
JayHawkfl

CTRL&V failure rate ~ 1 in 15

9 posts in this topic

#1 ·  Posted (edited)

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

 

Share this post


Link to post
Share on other sites



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

ControlSetText.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

I've been running hardware calls all day. I'll try this the next time I get a minute. Thank you for the quick responce


Thanks for your time

 

Share this post


Link to post
Share on other sites

Try sending shift + insert



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

Try sending shift + insert

Hotkey is a hotkey, that won't change anything.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0