Skip to content

Instantly share code, notes, and snippets.

@helmuthauser
Last active March 20, 2016 20:03
Show Gist options
  • Save helmuthauser/f97f77d2930cd8404687 to your computer and use it in GitHub Desktop.
Save helmuthauser/f97f77d2930cd8404687 to your computer and use it in GitHub Desktop.
# Helmut Hauser
# http://www.worksmartandberemarkable.com
# March 19, 2016
# code from http://hints.macworld.com/article.php?story=20070730101510623
# get the number of characters, word
set numCharacters to count (the clipboard)
set numWords to count words of (the clipboard)
set numParagraphs to count paragraphs of (the clipboard)
# send the numbers to the notification center
display notification "There are " & numCharacters & " characters" & return & "in " & numWords & " words in " & numParagraphs & " paragraphs" with title "Counting done:"
##############################################
# override the current clipboard with the current count
##############################################
# you can choose one of these options by removing the #
# just feed back number of characters
# set the clipboard to (numCharacters as text) & " characters"
# just feed back number of characters
set the clipboard to (numWords as text) & " words"
# feed back counts of characters and words
#set the clipboard to (numCharacters as text) & " characters in " & (numWords as text) & " words"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment