Skip to content

Instantly share code, notes, and snippets.

@danielpunkass
Created April 9, 2019 12:50
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 danielpunkass/b1cc0d9bcfa8d02ed7b5267e72b6b687 to your computer and use it in GitHub Desktop.
Save danielpunkass/b1cc0d9bcfa8d02ed7b5267e72b6b687 to your computer and use it in GitHub Desktop.
-- Line up a Python script for dynamically loading the private framework
-- and invoking the required private methods to get current grayscale mode
-- and set it to the opposite value.
set toggleGrayScript to "python -c 'from ctypes import cdll
lib = cdll.LoadLibrary(\"/System/Library/PrivateFrameworks/UniversalAccess.framework/UniversalAccess\")
lib.UAGrayscaleSetEnabled(lib.UAGrayscaleIsEnabled() == 0)
'"
do shell script toggleGrayScript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment