Jump to content

ClipPut("") no longer clearing my clipboard - (Moved)


Go to solution Solved by SOLVE-SMART,

Recommended Posts

I use autoit for repetitive tasks involving the copying and pasting from excel to our companies ERP system. I would always use ClipPut("") to clear my clipboard to prevent error, but recently it has not been clearing my clipboard. Now, if I run my script 5-10 times, I get the error that space can't be cleared on my clipboard.

Link to comment
Share on other sites

Hi @Maverick2002,

please share your code. This way we can possibly identify the problem.

Best regards
Sven

________________
Stay innovative!

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

Opt("SendKeyDelay",40) ;milliseconds delay between key strokes
Opt("SendKeyDownDelay",0)
Local $i = 0
HotKeySet("{ESC}", "Terminate")
Func Terminate()
    Exit
 EndFunc
 While $i <2    ;put total number of cells needing copied
   WinActivate("279.xlsx - Excel")        ;Go to Excel
   ClipPut("")
   Send("^c")
   WinActivate("Session A - Genesis")    ;Go to Genesis
   Send("{I}")                            ;Inquire
   Send("^v")
   Send("{ENTER}");Paste
   Send("C")
   Send("{TAB}")
   WinActivate("279.xlsx - Excel")
   Send("{RIGHT}")
   ClipPut("")
   Send("^c")
   Send("{DOWN}{LEFT}")
   WinActivate("Session A - Genesis")

   Send("^v")
   Send("{DOWN 2}{NUMPADADD}")
   Send("{ENTER 6}")

   $i = $i + 1
 WEnd

 

My hotkey stopped working as well

Link to comment
Share on other sites

Hi @Maverick2002,

I only could modify your script and test the part about ClipPut("") which works like expected on my maschine.
Did you change your AutoIt version? Which version do you have? Did you change anything else which could cause the strange behavior on your maschine?

You could use the Excel_UDF instead of these Send() actions to recieve your data.

Best regards
Sven

________________
Stay innovative!

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

  • Solution

Hi @Maverick2002,

definitely not nice, but please try this:

HotKeySet("{ESC}", "_Terminate")

Func _Terminate()
    Exit
EndFunc

Func _SendWithDelay($sKey, $iHowOften = 1, $iDelay = 120)
    For $i = 1 To $iHowOften Step 1
        Send($sKey)
        Sleep($iDelay)
    Next
EndFunc

Global Const $sExcel   = '279.xlsx - Excel'
Global Const $sGenesis = 'Session A - Genesis'

Global $i = 0

While $i < 2                    ; Put total number of cells needing copied
    WinActivate($sExcel)        ; Go to Excel
    ClipPut("")
    _SendWithDelay("^c")

    WinActivate($sGenesis)      ; Go to Genesis
    _SendWithDelay("{I}")       ; Inquire
    _SendWithDelay("^v")

    _SendWithDelay("{ENTER}")   ; Paste
    _SendWithDelay("C")
    _SendWithDelay("{TAB}")

    WinActivate($sExcel)
    _SendWithDelay("{RIGHT}")
    ClipPut("")
    _SendWithDelay("^c")

    _SendWithDelay("{DOWN}{LEFT}")
    WinActivate($sGenesis)

    _SendWithDelay("^v")
    _SendWithDelay("{DOWN 2}{NUMPADADD}")
    _SendWithDelay("{ENTER 6}")

    $i = $i + 1
WEnd

I just want to know if the following two lines, which are removed in my snippet above, cause your problem?

Quote

Opt("SendKeyDelay",40) ;milliseconds delay between key strokes
Opt("SendKeyDownDelay",0)

Best regards
Sven

________________
Stay innovative!

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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