googleRightClick.opml

Wow, Google API. Here's a bit of Friday evening fun. The following will perform a Google search on anything you right-click (control-click) on in Radio. Results will pop up in a new outline as an RSS file. Try it with someone's name in your Buddies list, or an outline heading in your instant outline.
NB You must have the Google API installed in your copy of Radio and you must have requested a Google activation key.
1) Put your cursor on the following heading and type Ctrl-/ (or Cmd-/ if you're using a Mac):
  edit (@user.tools.menus.rightClickmenu)
    true
2) In the window that opens (your right-click menu) make a new entry called "Google..."
3) Open this new menu item by 2x clicking on its little grey outliner triangle
4) A new script window called 'Script for "Google..."' opens.
5) Copy the following script and paste it into this script window
  bundle // Search using Google
    local
      htmlText
      itemStruct
      text = op.getLineText ()
      xmlText
    on add (s)
      htmlText = htmlText + s + cr
    on makeRssFile ()
      bundle //build xmltext
        local (indentlevel = 0)
        on add (s)
          xmltext = xmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"
        on encode (s)
          if system.environment.isMac
            return (xml.entityEncode (latinToMac.macToLatin (s), true))
          else
            return (xml.entityEncode (s, true))
        add ("<?xml version=\"1.0\"?>")
        add ("")
        add (""); indentlevel++
        add (""); indentlevel++
        add ("" + encode ("Google Search Results") + "")
        add ("" + encode ("http://www.google.com/") + "")
        add ("" + encode ("Results of a Google search") + "")
        if language != "none"
          add ("" + language + "")
        add ("" + "Copyright " + date.year () + " " + "Probably Google" + "")
        add ("" + date.netstandardstring (clock.now ()) + "")
        add ("http://backend.userland.com/rss092")
        add ("" + encode (user.prefs.name) + "")
        add ("" + encode (user.prefs.name) + "")
        bundle //add cloud element
          if flCloud
            with user.radio.prefs.rssCloud
              add ("")
        add (itemStruct)
        add (""); indentlevel--
        add (""); indentlevel--
    on addRSSitem (title, link, description)
      title = searchengine.stripmarkup (title)
      description = searchengine.stripmarkup (description)
      bundle //build xmltext
        local (indentlevel = 2)
        on add (s)
          itemStruct = itemStruct + string.filledstring ("\t", indentlevel) + s + "\r\n"
        on encode (s)
          if system.environment.isMac
            return (xml.entityEncode (latinToMac.macToLatin (s), true))
          else
            return (xml.entityEncode (s, true))
        add (""); indentlevel++
        add ("" + encode (title) + "")
        add ("" + link + "")
        add ("" + encode (description) + "")
        add (""); indentlevel--
    system.temp.googleSearch = google.search (text)
    if system.temp.googleSearch.endIndex == 0
      dialog.notify ("Sorry, nothing found at Google.")
      return (false)
    for n = 1 to system.temp.googleSearch.endIndex
      title = system.temp.googleSearch.resultElements [n].title
      if title == ""
        title = system.temp.googleSearch.resultElements [n].summary
      snippet = system.temp.googleSearch.resultElements [n].snippet
      url = system.temp.googleSearch.resultElements [n].url

      add ("
      " + n + ". " + title + "
      ")

      addRSSitem (title, url, snippet)
    makeRssFile ()
    op.rssToOutline (xmlText, @system.temp.googleRSSResults)
    edit (@system.temp.googleRSSResults)
6) Close the window (don't press the 'Run' button!)
You can now right-click on just about anything anywhere and get Google search results popping up in a new outline. The results will be an RSS file.
Have fun and let me know how you get on!
Thanks again to Userland for making this possible!
Usual caveats, use at your own risk, the code's probably crude, etc. But hey, we're just having some fun, right?