Skip to content

Instantly share code, notes, and snippets.

@kokaruk
Last active November 29, 2017 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kokaruk/17239648021fd677268f16d7b25a93ba to your computer and use it in GitHub Desktop.
Save kokaruk/17239648021fd677268f16d7b25a93ba to your computer and use it in GitHub Desktop.
set clipdata to get the clipboard as text
set the clipboard to my change_case(the clipdata, "upper")
on change_case(this_text, this_case)
if this_case is "lower" then
set the new_text to do shell script "echo " & quoted form of (this_text) & " | tr A-Z a-z"
else
set the new_text to do shell script "echo " & quoted form of (this_text) & " | tr a-z A-Z"
end if
return the new_text
end change_case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment