Skip to content

Instantly share code, notes, and snippets.

@astroud
Created January 31, 2012 21:34
Show Gist options
  • Select an option

  • Save astroud/1713059 to your computer and use it in GitHub Desktop.

Select an option

Save astroud/1713059 to your computer and use it in GitHub Desktop.

Revisions

  1. astroud revised this gist Aug 8, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions DigitalColor-Meter-fix.scpt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    -- Mountain Lion (10.8) fixed this oversight. The DigitalColor Meter now remembers it's settings on exit.

    -- DigitalColor Meter defaults to displaying color values in decimal and will not remember hexidecimal preferences on close. So this script launches the app and tells it to display values in hex. It is meant to be launched via QuickSilver or a launcher.

    -- Checks to see if System Preferences > Universal Access > Enable access for assistive devices is checked
  2. astroud created this gist Jan 31, 2012.
    21 changes: 21 additions & 0 deletions DigitalColor-Meter-fix.scpt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    -- DigitalColor Meter defaults to displaying color values in decimal and will not remember hexidecimal preferences on close. So this script launches the app and tells it to display values in hex. It is meant to be launched via QuickSilver or a launcher.

    -- Checks to see if System Preferences > Universal Access > Enable access for assistive devices is checked
    -- This option is required for "System Events" to use the keystroke and key code commands.
    -- If it is not checked, your password is required to make the change

    tell application "System Events" to if not UI elements enabled then
    set UI elements enabled to true
    end if


    -- Brings the app to the front and launches it if it's not running

    tell application "DigitalColor Meter" to activate


    -- Tells DigitalColor Meter to display values in hex by navigating through the menubar to change the "Display Values" preference

    tell application "System Events"
    click menu item "as Hexadecimal" of ((process "DigitalColor Meter")'s (menu bar 1)'s (menu bar item "View")'s (menu "View")'s (menu item "Display Values")'s (menu "Display Values"))
    end tell