Can I Monitor MAC OS X Clipboard?

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Can I Monitor MAC OS X Clipboard?

Post by BarrySumpter » Sun Feb 19, 2012 11:40 pm

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
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Can I Monitor MAC OS X Clipboard?

Post by Dixie » Sun Feb 19, 2012 11:43 pm

Barry...

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

be well

Dixie

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I Monitor MAC OS X Clipboard?

Post by BarrySumpter » Mon Feb 20, 2012 1:00 am

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?
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Can I Monitor MAC OS X Clipboard?

Post by Dixie » Mon Feb 20, 2012 1:13 am

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

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I Monitor MAC OS X Clipboard?

Post by BarrySumpter » Mon Feb 20, 2012 1:36 am

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.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can I Monitor MAC OS X Clipboard?

Post by FourthWorld » Mon Feb 20, 2012 5:45 am

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I Monitor MAC OS X Clipboard?

Post by BarrySumpter » Mon Feb 20, 2012 6:39 am

Yeah, thats MY question. LOL
I know windows does.

I've moved on to a drag n drop scenario instead.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “Mac OS”