|July 2, 2017|
Using TextExpander and AppleScript, I can easily get the current URL of the Chrome browser. This is useful when I want to share the URL in an email, Slack or a blog post.
I have two Snippets setup, one to get the URL and one to get the title of the page:
tell application "Google Chrome" set theURL to URL of active tab of window 1 end tell
Defined as: snippet:chrome.full.url
tell application "Google Chrome" set theTitle to TITLE of active tab of window 1 end tell
Defined as: snippet:chrome.title
Along with that setup, I have several other Snippets that references the above snippets. These are useful to have as I may want to display the URL differently depending on what applications that I am using.
Very useful when the page title is suitable for a link:
Create the anchor tag with the Chrome URL and put the cursor where I can enter in the link text
Create a link to the site using the content of the clipboard as the link text
I created a rich text snippet for email and Word Document
As you can see, it's really handy to have a couple of base snippets that are being used by other snippets.
Feel free to leave a comment about this post.