LC friends,

I have an app with basic word processing and I'm looking for the best way to
detect the source of what's on the clipboard. I'm trying to apply two rules:
1) Text formatted within LC can be copy/pasted with styled text using
clipboardData["styledText"]
2) Text formatted from outside of LC is pasted as plain text using
clipboardData["text"] (so LC field formatting is automatically applied to
it.)

The reason for rule 2 is to filter out formatting by Word or other sources
that tends to cause issues.

My kludgy method is to identify any text copied within LC by doing a
comparison. When there's a copy/cut cmd in LC, it stores a copy of that
Styledtext in a global variable. When a paste cmd is given, the
clipboardData["StyledText"] is compared to that variable. If it matches,
rule 1 applies, otherwise, rule 2.

I have this nagging feeling that there's a more direct way that I've
overlooked. Anybody know of one?

Thanks,
Tom Bodine



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Filtering-text-styles-on-the-Clipboard-tp4691239.html
Sent from the Revolution - User mailing list archive at Nabble.com.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to