Created
August 30, 2015 22:58
-
-
Save sasha42/2b510638720e0f33da7d to your computer and use it in GitHub Desktop.
Clear the formatting of your clipboard using a simple script placed in your (mac) dock
This file contains hidden or 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
#!/bin/bash | |
# This small program cleans up the formatting of your mac clipboard | |
# (removes any links, coloring, font style, spacing, etc). Drag it | |
# into your dock and click on it whenever you want to clear some | |
# text's formatting. It will then close all by itself. Requires | |
# giving accessibility rights to terminal. | |
# Suggested as alias here https://news.ycombinator.com/item?id=10143852 | |
pbpaste | pbcopy | |
# Took example from http://stackoverflow.com/a/21118491 | |
closeWindow() { | |
/usr/bin/osascript << _OSACLOSE_ | |
tell application "Terminal" | |
close (every window whose name contains "clipboard-clean.sh") | |
end tell | |
tell application "System Events" to click UI element "Close" of sheet 1 of window 1 of application process "Terminal" | |
_OSACLOSE_ | |
} | |
closeWindow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment