It needed some minor tweaking to make work:
#!/bin/zsh STATUS=$1 if [ -z $STATUS ]; then STATUS="Available" fi TMPF=/tmp/ascript cat > $TMPF <<-EOF tell application "System Events" to tell UI element "HipChat Mac" of list 1 of process "Dock" perform action "AXShowMenu" delay 0.5 click menu item "Status" of menu 1 click menu item "$STATUS" of menu 1 of menu item "Status" of menu 1 end tell EOF osascript $TMPF
It is limited, but better than nothing. The status must match EXACTLY the menu text if you right click on the HipChat icon on the dock. So.. no custom status messages, but better than nothing. Combined with ControlPlane I keep my team up to date.