Sign in to follow this  
Followers 0
supadodger

is there a simple way to pause a script until clipboard changes?

17 posts in this topic

i want a script to pause repeatedly until clipboard changes.

i have something i have to do 1800 times and i have to do part of it manually but the part after i copy to clipboard will always remain the same.

so i would like to automate that part and then have it pause again.

Share this post


Link to post
Share on other sites



i want a script to pause repeatedly until clipboard changes.

i have something i have to do 1800 times and i have to do part of it manually but the part after i copy to clipboard will always remain the same.

so i would like to automate that part and then have it pause again.

sounds like you should be using a loop rather than a pause.

If you pause the script, it won't "look" for anything, any longer.

Share this post


Link to post
Share on other sites

Simple example:

$clip = ClipGet()

While $clip = ClipGet()
    Sleep(100)
WEnd

MsgBox(0, "", "Clipboard has changed!")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$oldclip = ClipGet()
While 1;this will loop it endlessly
 If $oldclip <> ClipGet() Then
    _DoSomething();run a custom function, set it whatever you want for it.
  Else
  ;;;
 EndIf
 Sleep(100)
Wend

Func _DoSomething()
 ;fill any action you need when clipboard changes
EndFunc

Edited by soulhealer

Share this post


Link to post
Share on other sites

Simple example:

$clip = ClipGet()

While $clip = ClipGet()
    Sleep(100)
WEnd

MsgBox(0, "", "Clipboard has changed!")
but wont wont $clip change everytime the clipboard changes causing $clip to always = $clipget ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

but wont wont $clip change everytime the clipboard changes causing $clip to always = $clipget ?

No, because AutoIt behaves according to the previous instruction or context.

$clip = ClipGet();Assignment, sets $clip to be the clipboard contents

But

While $clip = ClipGet();boolean comparison, checks if $clip is the same as the clipboard contents without changing $clip

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

but wont wont $clip change everytime the clipboard changes causing $clip to always = $clipget ?

nah i tried.

i didnt give autoit enough credit.

this will simplify a ton of scripts i write assuming that it wont notice the changes to my $variables without a while $variable = "BLAH"

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Dim $I = 0 , $X = 0
Do
If $X = 0 Then
$ClipGet1 = ClipGet()
$X = 1
Else
Sleep(100)
$ClipGet2 = ClipGet()
If $ClipGet1 <> $ClipGet2 Then MsgBox(0, "Clipboard", "Clipboard has changed!")
$X = 0
EndIf
Until $I = 1

Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

$fc = ClipGet()

While ClipGet() = $fc
Sleep(250)
WEnd
MsgBox(64, 'ClipGet', 'ClipBoard has changed !' & @CRLF & ClipGet())

Not tested.

Cheers, FireFox.


 

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

$fc = ClipGet()

While ClipGet() = $fc
Sleep(250)
WEnd
MsgBox(64, 'ClipGet', 'ClipBoard has changed !' & @CRLF & ClipGet())

Not tested.

Cheers, FireFox.

Tested... works like a charm!

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

@November

Im happy to have done something working without testing it :)

Cheers, FireFox.


 

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

;)

@November

Im happy to have done something working without testing it :think:

Cheers, FireFox.

:)

What a partnership... :shhh:

I'll try to be more beta tester than developer :lmao:

Cheers m8 :>


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

Okay I see some code for a one pass but how will you see any other? All you need to accomplish this task is:

GUIRegisterMsg($WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD")

Do
    _DoAnything()
Until GUIGetMsg() = $GUI_EVENT_CLOSEoÝ÷ Úz0²)Ü{*.q©eyÖ«z¬µêÞvg¬±¨Ê§yçm¡×w¢µ«­¢+ÙÕ¹5µ½]É¥Ñ ÀÌØíÍ5ÍÍôÅÕ½ÐìÅÕ½Ðì¤(U%
ÑɱMÑÑ ÀÌØí¥5µ¼°ÀÌØíÍ5Í͵Àì
I1°Ä¤)¹Õ¹ìôôÐí5µ½]É¥Ñ()Õ¹]5}I]
1%A =I ÀÌØí¡]¹°ÀÌØí¥5Í°ÀÌØí¥ÝAÉ´°ÀÌØí¥±AÉ´¤(5µ½]ɥѡ}
±¥Á  ½É}ÑÑ ¤¤)¹Õ¹ìôôÐí]5}I]
1%A =I

Yes, I know I declared two functions there but always have a side Memo for when I'm doing task, they are easily removed for the final product


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

@November

Im happy to have done something working without testing it :)

Cheers, FireFox.

I can't really see any difference from your script and the one I posted other than that you changed the variable name and increased the sleep...

Share this post


Link to post
Share on other sites

@Pain

Halala... :) whats the problem with autoit members ? I didnt see yours, and you dont have to reply by saying that youve written it first or something like this... i just dont care :lmao:

Cheers, FireFox.


 

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 didn't mean to be rude or something, I'm sorry if that's how you got it. It's a verry basic script and only a few ways to do it (all pretty much the same anyway) so it's possible that you just didn't saw my post but it sounded like you ignored me.

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