Created
May 25, 2012 04:00
-
-
Save azur256/2785667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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