Displaying Color Picker: Why Doesn't this Work?
  • I just found a cool hint at Mac OSX Hints that uses a 1-line script to open the Apple color picker in applications that don't use the color picker. (See http://www.macosxhints.com/article.php?story=20060408050920158&lsrc=osxh)

    The script is ridicuously short:

    choose color

    That's it.

    Now, when I bring this script up in Launchbar, it works fine, but when I run it from Fastscripts, it locks things up. Just wondering why. Thanks.

    Doug
  • Hi Doug - very interesting bug. I was able to reproduce the problem immediately upon trying. I don't know why but for some reason calling choose color directly from FastScripts like that causes a hang. I think it's because the color picker is trying to run the event loop, but the event loop is busy handling the applescript itself.

    At any rate, I'm going to look into it more deeply as soon as possible, but as a temporary workaround, how about this script, which always addresses the frontmost application:

    tell application \"System Events\"
    set frontAppName to name of (first application process whose frontmost is true)
    end tell

    tell application frontAppName
    choose color
    end tell

    Let me know how that works for you!

    Daniel
  • This script, saved as an application: choose color, works perfectly as you might guess.
  • Daniel,

    You're new script does work ... to a point. It opens the color picker, but it still keeps FastScripts busy (the menubar icon is still highlighted and I can't select it as long as the color picker is open). Once I close the color picker, everything is back to normal. Assuming I'm going to use the color picker immediately and then close it (which I probably am), it works fine. Thanks.

    Doug
  • Aha - thanks Doug. Yeah I observe that now, too. There's definitely something funky going on, and I hope to get to the bottom of it.

    Daniel
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!