Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
Created April 9, 2016 05:56
Show Gist options
  • Save brandonpittman/c471f250d1452dc1f5c1a85e75775922 to your computer and use it in GitHub Desktop.
Save brandonpittman/c471f250d1452dc1f5c1a85e75775922 to your computer and use it in GitHub Desktop.
Use TextExpander to generate an email address
if (Application('Safari Technology Preview').running()) {
safari = Application('Safari Technology Preview')
} else if (Application('Safari').running()) {
safari = Application('Safari')
}
_tab = safari.windows[0].currentTab()
if (_tab.url().match(/http.?:\/\/www/)) {
_url = _tab.url().split("www.")
} else if (_tab.url().match(/http.?:\/\//)) {
_url = _tab.url().split("//")
} else {
_url = _tab.url().split("www.")
}
_domain = _url[1].split(".")[0]
_domain + "@brandonpittman.net"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment