Page 1 of 1

Event in other application

Posted: Sun Sep 26, 2021 3:02 pm
by vagappc
Hi guys, I am VagaPPC this is my first question in this forum.
Sorry for my bad english.

I would like to read the ClipBoard from others application, but if running this code, read only last menorized clip.
How do I get him to read another CliBoard?

Code: Select all

Function p_Clip()

    type, data = GetClipboard()
    If type <> #CLIPBOARD_TEXT
       data = "Non è testo"
    EndIf

    NPrint(data)

EndFunction

InstallEventHandler({ ClipboardChange = p_Clip() ))

Repeat
    WaitEvent
Forever  

Re: Event in other application

Posted: Sun Sep 26, 2021 6:17 pm
by plouf
HEllo Vagan, welcome

InstallEventHandler must be used without brackets (), the message from hollywood is about the Closing } (not ))

Code: Select all

Function p_Clip()
    type, data = GetClipboard()
    If type <> #CLIPBOARD_TEXT
       data = "Non è testo"
    EndIf
    NPrint(data)
EndFunction

InstallEventHandler({ ClipboardChange = p_Clip })

Repeat
    WaitEvent
Forever

Re: Event in other application

Posted: Sun Sep 26, 2021 9:57 pm
by vagappc
Now it works thanks