Okay, I'm tired of the 12 smileys here, so I wrote an AppleScript to make it easier to use Simple Smileys using
. Easy-peasy.
The problem is that in order to get the text into Safari, I've had to use the clipboard. This clears whatever I had on the clipboard before, which might be pretty inconvenient for posting pertinent URLs and such. This is the offending bit of code:
When I uncomment the first and last lines, the script outputs whatever had been on the clipboard before it was run, and the contents of the clipboard don't change. I can't for the life of me work out why this is. It's like it ignores the second line altogether.
Any suggestions? Using the clipboard is itself a workaround, and I'd prefer if my script could type the text directly. I haven't been able to figure out how to do that.
Edit 1: The attached app isn't protected from import, so it can be opened in Script Editor.
Edit 2 to add:
I just tried using
and it does work, but it takes some time to type the URL out. Using the clipboard is considerably faster.

The problem is that in order to get the text into Safari, I've had to use the clipboard. This clears whatever I had on the clipboard before, which might be pretty inconvenient for posting pertinent URLs and such. This is the offending bit of code:
Code:
--set temp_clipboard to the clipboard
set the clipboard to bbcode
tell application "Safari" to activate
tell application "System Events" to keystroke "v" using {command down}
--set the clipboard to temp_clipboard
When I uncomment the first and last lines, the script outputs whatever had been on the clipboard before it was run, and the contents of the clipboard don't change. I can't for the life of me work out why this is. It's like it ignores the second line altogether.
Any suggestions? Using the clipboard is itself a workaround, and I'd prefer if my script could type the text directly. I haven't been able to figure out how to do that.
Edit 1: The attached app isn't protected from import, so it can be opened in Script Editor.
Edit 2 to add:
I just tried using
Code:
tell application "System Events" to keystroke bbcode
and it does work, but it takes some time to type the URL out. Using the clipboard is considerably faster.