Script to examine clipboard before pasting
I've had some success using a beforePaste() event-listener to help users avoid pasting formatted text in places where they shouldn't. This script could be a lot smarter if it could look at the contents of the clipboard first. Even a simple count of the paragraphs would be a big help.
From browsing this forum, it appears that the most common idea for checking clipboard contents in JS is to create a temporary text frame, paste into it and then get the contents of the temporary frame. But I seem to recall that AppleScript had direct access to the contents of the clipboard and have read that VBscript might as well.
So: does anyone have a snippet that shows how to use VBscript to get the contents of the clipboard and pass it to javascript?
