I was trying out some new icons in the dock Brad was working on, and found that it's a bit annoying having to relaunch an app to test this. So what I needed was an app that would update it's icon in the dock with a new image, without having to relaunch it. I swear one of the Apple supplied dev tools would do this, but I can't find it anywhere.
Then Paul Kim pointed me to his Status Item Tester which does exactly what I wanted. Much easier. Just drag and drop out of Acorn into his window and it does the trick.
Then I remembered.. hey- Acorn has a plugin API, doesn't it? Why yes, I'm pretty sure it does!
10 seconds later, the "Make Dock Icon" plugin was born:
ACScriptSuperMenuTitle = None
ACScriptMenuTitle = "Make Dock Icon"
def main(image):
NSApplication.sharedApplication().setApplicationIconImage_(image.NSImage())
return nil
It really is that easy to write useful plugins for Acorn. Well, at least in this case- useful for developer types like myself. And there's a handful of examples on the Acorn wiki if you're interested in making your own.