I use an Applescript to open a Javascript prompt for YubNub in Safari. Occasionally I use a search scope more often like "ebay" ect and I would like the Yubnub command already typed in the prompt so I can just type my search. I have tried the following script to type "ebay" in the prompt and it only shows an empty prompt. Any help would be appreciated. Thanks.
the script:
tell application "Safari"
do JavaScript
"javascript:Qr=prompt('','');if(Qr)location.href='http://www.yubnub.org/parser/parse? command='+escape(Qr)" in current tab of first window
end tell
delay 0.3
tell application "System Events" to key code 14
tell application "System Events" to key code 11
tell application "System Events" to key code 0
tell application "System Events" to key code 16