Skip to content

Instantly share code, notes, and snippets.

@azur256
Created May 25, 2012 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azur256/2785667 to your computer and use it in GitHub Desktop.
Save azur256/2785667 to your computer and use it in GitHub Desktop.
on displayErrorMessage(s)
display dialog (s) buttons {"OK"} default button "OK" with icon caution
end displayErrorMessage
tell application "MarsEdit"
try
set currentWindow to document 1
on error errorMessage
displayErrorMessage("Can’t run a Google search because no posts windows are open. This script searches using the selected text of the frontmost window.") of me
return
end try
set queryString to selected text of currentWindow
if (queryString is equal to "") then
displayErrorMessage("Can’t run a Google search because no text is selected.") of me
return
end if
end tell
tell application "Safari"
search the web for queryString & " site:azur256.blogspot.com"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment