Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A set of TextExpander snippets for getting and transforming the URLs of current browser pages.

branch: master

Need to escape # in URLs.

Not sure why I had it in the list of excluded characters to begin with.
latest commit 0dfd572eb1
Dr. Drang authored
Octocat-spinner-32 1surl Initial commit.
Octocat-spinner-32 1url Initial commit.
Octocat-spinner-32 2surl
Octocat-spinner-32 2url Initial commit.
Octocat-spinner-32 3surl
Octocat-spinner-32 3url Initial commit.
Octocat-spinner-32 4surl Initial commit.
Octocat-spinner-32 4url Initial commit.
Octocat-spinner-32 500 Initial commit.
Octocat-spinner-32 5surl Initial commit.
Octocat-spinner-32 5url Initial commit.
Octocat-spinner-32 6surl Initial commit.
Octocat-spinner-32 6url
Octocat-spinner-32 README.md Update README to warn that appscript needs to be installed for the Fl…
Octocat-spinner-32 escapeurl
Octocat-spinner-32 flickr Initial commit.
Octocat-spinner-32 furl Initial commit.
Octocat-spinner-32 psurl Initial commit.
Octocat-spinner-32 surl Initial commit.
README.md

These are the TextExpander snippets I use to capture the URLs of pages I'm browsing and, in some cases, transform them. They use either AppleScript directly or Python with the appscript library and work with both Safari and Google Chrome.

The multibrowser logic works this way:

  1. If Safari is running, regardless of whether Chrome is running, get the URL from Safari.
  2. If Chrome is running, and Safari isn't, get the URL from Chrome.

furl

This is an AppleScript snippet that prints the URL of the frontmost tab of the frontmost browser window ("furl" = "front URL"). I use the abbreviation ;furl to invoke it.

The original version of this snippet (written for TypeIt4Me) is described here. I carried it along when I switched to TextExpander, then generalized it to handle both Chrome and Safari here.

1url – 6url

These are AppleScript snippets that print the URL of the *n*th tab, counting from the left, of the frontmost browser window. I use the abbreviations ;1url through ;6url to invoke them.

These expansions of ;furl were first described here and generalized to work with Chrome and Safari here.

surl

This is an AppleScript snippet that prints the shortened URL of the frontmost tab of the frontmost browser window ("surl" = "shortened URL"). It uses the Metamark shortening API, which requires special characters in the input URL to be encoded. The escapeurl script, included in the repository, is called by snippet to do the encoding. I use the abbreviation ;surl to invoke it.

Like ;furl this was first written for TypeIt4Me and described here, then generalized to work with Chrome and Safari here.

1surl – 6surl

These are AppleScript snippets that print the shortened URLs of the *n*th tab, counting from the left, of the frontmost browser window. It uses the Metamark shortening API, which requires special characters in the input URL to be encoded. The escapeurl script, included in the repository, is called by snippet to do the encoding. I use the abbreviations ;1surl through ;6surl to invoke them.

These snippets were first described here.

psurl

This is an AppleScript snippet that prints the shortened URL of the frontmost tab of the frontmost browser window in parentheses. It uses the Metamark shortening API, which requires special characters in the input URL to be encoded. The escapeurl script, included in the repository, is called by snippet to do the encoding. I use the abbreviation (;surl to invoke it.

This snippet was born out of frustration. I often put shortened URLs in parentheses in tweets, and I found myself—because TextExpander insisted on it—invoking ;surl and then going back to put in the parentheses. This snippet made thing go much faster.

This snippet was first described here.

flickr

This is a shell script snippet written in Python/appscript. It prints the "flic.kr" shortened URL for the Flickr photo in the frontmost tab of the frontmost browser window. I use the abbreviation ;flickr to invoke it.

This snippet was first described here.

500

This is a shell script snippet written in Python/appscript. It prints the URL of the smaller medium-sized version (the one that's 500 pixels wide if landscape) of the Flickr photo in frontmost tab of the frontmost browser window. I use the abbreviation ;500 to invoke it.

This snippet was first described here, then improved to handle more Flickr pages here.

Note: The appscript library isn't part of the standard distribution, and you won't be able to use the Flickr snippets unless you install it, which will also require (I think) the installation of Apple's developer tools.

Something went wrong with that request. Please try again.