Loading ...
Sorry, an error occurred while loading the content.

Re: OT: Applescript to search current web site via Google

Expand Messages
  • John Rethorst
    Posting changed some smart quotes to dumb quotes. Try: property searchText : tell application Safari to set rawURL to URL of document 1 set url1 to text 8
    Message 1 of 2 , Nov 11, 2006
    • 0 Attachment
      Posting changed some smart quotes to dumb quotes. Try:


      property searchText : ""

      tell application "Safari" to set rawURL to URL of document 1

      set url1 to text 8 thru length of rawURL

      if url1 contains "/" then
      set offset1 to offset of "/" in url1
      set thisURL to text 1 thru (offset1 - 1) of url1
      else
      set thisURL to rawURL
      end if

      set searchText to text returned of (display dialog "Search " & ¬
      thisURL & " via Google for:" default answer searchText)

      open location "http://www.google.com/search?&rls=en&q=" & ¬
      searchText & "+site:" & thisURL

      John R.
    Your message has been successfully submitted and would be delivered to recipients shortly.