Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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