Hi,
So I have a script which copies selected text from any app and uses pbpaste to pass it to a command line app that processes it and returns a result that I then go on to use to create calendar events.
The script works fine, except, I didn’t want the script to have a lasting affect on any pre-existing clipboard contents, so I save the clipboard contents in a variable before doing the copy and then I put it back on the clipboard when my script finishes. However, sometimes, what’s on the clipboard isn’t just plain text and I get this applescript error:
Here’s the code that generates the error:
set theSpare to the clipboard as record
Is there a better way to do this that avoids the error?
Thanks,
Rob