Created
October 27, 2013 17:11
-
-
Save Zettt/7185129 to your computer and use it in GitHub Desktop.
Script that uses frontmost tab and opens its Google Cache page. Wrote this while http://www.bishopfox.com/blog/2013/10/linkedin-intro/ was down.
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
set googleCacheURL to "http://webcache.googleusercontent.com/search?q=cache:" | |
tell application "Safari" | |
-- get url of frontmost tab | |
set safariWindow to first window | |
set originalURL to (URL of current tab of safariWindow) as text | |
--log originalURL | |
end tell | |
-- remove http:// or https:// | |
if originalURL starts with "http://" then | |
set cacheURL to characters 8 thru (length of originalURL) of originalURL as text | |
else if originalURL starts with "https://" then | |
set cacheURL to characters 9 thru (length of originalURL) of originalURL as text | |
end if | |
--log cacheURL | |
open location googleCacheURL & cacheURL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment