Use a Zsh Function With AppleScript to Get the URL From Chrome
DRANK

AppleScript is a powerful and strange language that allows you to interact with apps in a wide variety of ways. One feature it enables is the ability to get the URL from Chrome so that you can take the URL and do whatever you want with it. clone(){ cd ~/projects url=$(osascript -e 'tell application "Google Chrome" to return URL of active tab of front window') repo=${url:19} name=${repo:t} git clone git@github.com:$repo && code $name } `

egghead.io
Related Topics: Shell Google Chrome Web Standards / Browsers