Page 1 of 1

Can I Monitor MAC OS X Clipboard?

Posted: Sun Feb 19, 2012 11:40 pm
by BarrySumpter
Hi all,

In Windows I can monitor the clipboard contents.
i.e. receive a notice/event when the clipboard is being used.

Can I monitor the clipboard events/contents in Mac OS X with LiveCode?

Lets say I want to do something if the file name of the clipboard content is *.avi or *.mov etc.

tia

Re: Can I Monitor MAC OS X Clipboard?

Posted: Sun Feb 19, 2012 11:43 pm
by Dixie
Barry...

Look at 'clipboard' and 'clipboard data' in the dictionary...

be well

Dixie

Re: Can I Monitor MAC OS X Clipboard?

Posted: Mon Feb 20, 2012 1:00 am
by BarrySumpter
Already been there done that hince my query here:

i.e. can I set LiveCode to monitor the clipboard and receive a notice/event when the clipboard is being used?

Re: Can I Monitor MAC OS X Clipboard?

Posted: Mon Feb 20, 2012 1:13 am
by Dixie
Well Barry...

I have not done it myself, but, after reading the comments in the dictionary, especially regarding the 'clipboard function' that points out to the reader that 'The value of the clipboard function is a string describing what kind of data is on the clipboard. LiveCode can paste text that has been cut or copied, or picture content from an image, one or more objects that have been cut or copied. If the clipboard has nothing in it, or the contents of the clipboard is a type of data that is not text, image data, or objects, the clipboard function returns empty.'... so, the answer is 'Yes'... check the clipboard contents periodically, perhaps using a 'send in time' instruction from within an appropriate handler...

Dixie

Re: Can I Monitor MAC OS X Clipboard?

Posted: Mon Feb 20, 2012 1:36 am
by BarrySumpter
Hi Dixie, many thanks for the responses.
Yeah thought of that as well.
But app needs to react to all clipboard activities.
There could be a number of activities with the clipboard by the time I check it.
And I don't want LiveCode timers checking the CB every few seconds just to see if its changed.
I'd like to know if its a copie or paste event, etc.
I'll have to find a workaround and change the methodology of what I'm trying to do.
Thanks again.

Re: Can I Monitor MAC OS X Clipboard?

Posted: Mon Feb 20, 2012 5:45 am
by FourthWorld
BarrySumpter wrote:But app needs to react to all clipboard activities.
"All" is pretty big.

Does the OS even provide any APIs for this sort of thing?

Re: Can I Monitor MAC OS X Clipboard?

Posted: Mon Feb 20, 2012 6:39 am
by BarrySumpter
Yeah, thats MY question. LOL
I know windows does.

I've moved on to a drag n drop scenario instead.