Jump to content
AndreyS

The problem with the correct operation of ClipGet()

Recommended Posts

AndreyS

Developers, can anyone explain this phenomenon to me?
Run this code and wait for nothing without doing a few minutes and you will start receiving randomly, either one or the second message. But none of them should never appear on the logic of the code!
As I understand sometimes the function ClipGet () returns an empty value. Why is this happening?

Dim $ClipGetText

ClipPut("12345")

While 1
    Sleep(5) ;reduced to 5 to better see the problem
    if ClipGet()<>$ClipGetText And ClipGet()<>"" Then
            $ClipGetText=ClipGet()
            Beep(800,100)
            ConsoleWrite(ClipGet()&"|"&$ClipGetText&@CRLF)
    ElseIf ClipGet()="" Then
        Beep(800,100)
        ConsoleWrite("Empty"&@CRLF)
    EndIf
WEnd

 

Share this post


Link to post
Share on other sites
JLogan3o13

I let it run for 10 minutes and saw nothing beyond the initial

Quote

12345|12345

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Melba23

AndreyS,

Same result here.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
AndreyS

Then I do not know how to explain this ?!
I see over 3 minutes, for example the following:
Empty
Empty
Empty
12345 | 12345
Empty
Empty

Edited by AndreyS

Share this post


Link to post
Share on other sites
BrewManNH

I am still running it and it's been 25 minutes and the only time it shows empty is occasionally when I copy something new to the clipboard. Other than that it's being completely quiet.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
AndreyS

Here again I launched and for one minute received the following result:
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
Empty
12345 | 12345

Share this post


Link to post
Share on other sites
BrewManNH

Why does your output keep showing the 12345|12345?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
AndreyS

No no - you do not need to copy anything while doing this.

"only time it shows empty"
And yet you have received this message at least once! And it should not have been one!


I do not know why the rest do not get such problems. Maybe it depends on the power of the computer.

Share this post


Link to post
Share on other sites
AndreyS

"Why does your output keep showing the 12345 | 12345?"
As I understood and wrote above, the ClipGеt() function seems to fail to work and produces an empty result because of this and this problem is obtained.

Share this post


Link to post
Share on other sites
BrewManNH

Your script as written above should never produce this output.

Quote

12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
12345 | 12345
Empty
12345 | 12345

As to my results showing empty, as I stated, it only shows the empty line when I copy new information to the clipboard.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
AndreyS

I still thought that! Maybe some third-party program affects the clipboard somehow ?! I'll try to close all programs as much as possible and see if there is any dependence!

Yes, yes, based on the code, there should not be a single message other than the first.

Edited by AndreyS

Share this post


Link to post
Share on other sites
AndreyS

I seem to have caught the dependence on one of my programs.
In it there is such line:
If ClipGet() <> $TextForClipb And StringInStr(ClipGet(), ":") > 0 And Number(StringMid(ClipGet(), StringInStr(ClipGet(), ":") + 1, 1)) > 0 And StringLen(ClipGet()) < 40 Then ...

Tell me, can it affect the contents of the clipboard? And because of this, I get that output messages that should not be displayed?

Share this post


Link to post
Share on other sites
AndreyS

I found respected developers dependency!
It turns out you can not even just access simultaneously from different scripts to the buffer! Otherwise, such inadequate results are obtained.
Copy the following script:

Dim $CBValue

While 1
    $CBValue=ClipGet()
WEnd

Run it and then run my example.

Share this post


Link to post
Share on other sites
JLogan3o13

Is this what you've been doing? Why didn't you explain this in the beginning? The last two posts are completely different than your first; we can't help you when you're not giving us all the info up front.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
AndreyS

JLogan3o13 you do not correctly understand me apparently. You need to run two scripts! Compile the last and run. And from the editor, run my first code!

The second script I just invented quickly to check how they will work in parallel. Also I understood why you do not receive messages, and I received. My second program, which was always running when developing a new program, also uses ClipGet (). So there was a conflict.

What is the problem and how to solve it now? After all, any scripts should work correctly and do not have such influence on each other.

Edited by AndreyS

Share this post


Link to post
Share on other sites
AndreyS

Dear experts, I'm very grateful to you for responding so quickly to my topic!

But where did you all disappear so quickly? You do not understand the problem or think how to solve it?

Say at least something please.

Share this post


Link to post
Share on other sites
Jos

My guess is that this whole topic till now isn't make much sense so hence am I staying out.
I see absolutely no reason why one would want to do what you are trying to test here.
Tell us exact information on how you fill/refresh the clipboard and what it is you want to do that isn't working and you might have better luck getting answers.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
AndreyS

So you really do not understand anything?
I've given you two scripts that show that the ClipGet () function is buggy when it uses two different scripts at the same time!
This is absurd and so it should not be!

You still do not understand anything?

Share this post


Link to post
Share on other sites
Jos
Just now, AndreyS said:

This is absurd and so it should not be!

You still do not understand anything?

mmm....  Is this your polite way of asking for help, not answering any of my questions and arguing that I am stupid?  
Fuck you too!

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
AndreyS

So when one of the programs uses the ClipGet () function, then that gets absurd results when using ClipGet () at this time. That's what I showed you on the example of my two scripts.

I showed you this in examples and in different ways and tried to answer all your questions! If on some did not answer then I did not understand them! I'm not special, like you, in English!

Jos, I did not insult you in the least way since you insulted me now! I'm talking only about the error in language and function. And you insulted me!

Thank you for such help: send me away. From whom from whom but from you I did not expect this and had a different opinion.

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

  • Similar Content

    • k4rl3on
      By k4rl3on
      hello
      I have problem with ClipGet () function: If the clipboard contains a large amount of data the use of the function pushes the consumption of cpu resources to 100% and my script unresponds until I force it to end.
      I tried to work around the problem by limiting the size of the recovered data from the clipboard

       
      Local = $ClipBoardData = StringMid(ClipGet (), 1.1024) I also used:

       
      DllCall ("psapi.dll", "int", "EmptyWorkingSet", "long", -1) to free the memory after each call to ClipGet ()
    • LearnIt
      By LearnIt
      Hi everyone!
      I recently started working after college and we use a lot of excel. As I was searching for ways to improve efficiency I came across AutoIt, so I decided to learn. I've put in some hours of reading through the search function on the website and the AutoIt library for my issue, but I cannot seem to find my answer and I am having trouble understanding some stuff.
      What I am trying to do is get AutoIt to paste a string into several different boxes. I want the script to know that each '-' in the copied text it should press tab and skip past the '-' and paste/type the following numbers. Here's an example of the text I will copy and press a F5 (eventually set up a hotkey) to run the script: 0123-456-7891-01112131-000-1234-456
      Here's my code so far: (Btw, I know the ending of the code doesn't make sense, I was editing it and what not, it's just that I don't know how to efficiently use the clipget() and stringsplit() functions.
      #RequireAdmin AutoItSetOption('MouseCoordMode',0) WinWait('Oracle Applications - XXXX Production') WinActivate('Oracle Applications - XXXX Production') MouseClick('primary', 38, 408, 2, 0) StringSplit(ClipGet(),"-") Send("{TAB}") Send(ClipGet()) I would like to paste it in the box in the attached picture.

      Even if there is not a way for autoit to skip past the '-' I can just copy the entire string without the '-' and I would like autoit to paste the first 4, then press tab, paste the next 3, press tab, etc etc. Any of those methods work.    Thank you for taking the time to read through this and attempting to responding!
×