osx - Is there a mac app that will post a growl notification when an app starts/stops responding?

29
2013-07
  • Chris R

    Basically, I want to get a growl display when either an app starts beachballing, or when a previously beachballed app wakes up and starts taking UI requests again. Does such a beast exist?

  • Answers
  • ridogi

    I've never used Keep-It-Up but I can't think of anything else that does this (if it in fact works). It has a few strikes against it—not updated recently, costs money, and PPC build.

    If you wanted to know when an application had crashed that would be possible with a shell script, but knowing when an app is not responding is a pretty tall order.

    Edit: Here is a shell script I just wrote to check if an application is running:

    #! /bin/bash
    
    app="/Applications/Safari.app/Contents/MacOS/Safari"
    
    checkrunning=$(ps -u username | grep $app | grep -v grep | grep -c $app)
    
    if
            test $checkrunning -gt 0
    then
            exit
    else
            growlnotify $app is not running
    fi
    

    To get this working you would need to:

    1. Enter your username in the script.
    2. Put the path of the app you want to monitor in the app variable in the script, keeping the quotes. I used Safari as an example.
    3. Set it to run once every X seconds or minutes with launchd or Lingon.

    Caveat: I've never used growlnotify so you'll want to make sure I'm not missing an argument on that line. Also, this won't tell you if the app is not responding, just if it is not running at all, and you'll need to keep it running all the time or you will keep getting the growl notification.



  • view all most popular Amazon Coupons
    .

    Related Question

    osx - How can I force Growl notification of the currently playing iTunes track?
  • wemayfreeze

    I'd like a hot-key to tell (ask politely) Growl to throw up a notification of what's currently playing in iTunes.

    I've poked around a bit but couldn't find an answer "out there."

    Any thoughts?


  • Related Answers
  • Orion751

    If you prefer the format that GrowlTunes supplies, you can also create a script that uses it:

    tell application "GrowlTunes" to show current track
    
  • wemayfreeze

    My hacked Applescript posted below. This matches the Growl output of iScrobbler. Thanks to The Tentacle for the work! There's information on how to set Quicksilver to launch the script here.

    tell application "GrowlHelperApp"
    -- Make a list of all the notification types
    -- that this script will ever send:
    set the allNotificationsList to {"iTunes Playing Track"}
    -- Make a list of the notifications
    -- that will be enabled by default.
    -- Those not enabled by default can be enabled later
    -- in the 'Applications' tab of the growl prefpane.
    set the enabledNotificationsList to {"iTunes Playing Track"}
    -- Register our script with growl.
    -- You can optionally (as here) set a default icon
    -- for this scripts notifications.
    register as application "Growl iTunes Notification" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "iTunes"
    
    set title_text to "Null"
    set body_text to ""
    set body_temp to ""
    set has_artwork to false
    
    tell application "iTunes"
    	if player state is playing then
    		set trck to current track
    
    		if artworks of trck is not {} then
    			get artwork 1 of trck
    			set pic to data of result
    			set has_artwork to true
    		end if
    
    		set title_text to "Now Playing"
    
    		get name of trck
    		set body_text to "Track: " & result
    
    		get rating of trck
    		set rate to result / 20
    
    		repeat rate times
    			set body_temp to body_temp & "★"
    		end repeat
    
    		if rate is less than 5 then
    			repeat (5 - rate) times
    				set body_temp to body_temp & "☆"
    			end repeat
    		end if
    
    		set body_text to body_text & " (" & body_temp & ")" & return
    
    		get album of trck
    		set body_text to body_text & "Album: " & result & return
    
    		get artist of trck
    		set body_text to body_text & "Artist: " & result
    
    	end if
    end tell
    
    if has_artwork then
    	notify with name "iTunes Playing Track" title title_text description body_text application name "Growl iTunes Notification" pictImage the pic
    else
    	notify with name "iTunes Playing Track" title title_text description body_text application name "Growl iTunes Notification" image from location "file:///Users/drewbeck/Library/Scripts/Custom/no_album.tiff"
    end if
    

    end tell

  • koenigdmj

    You need a plugin for iTunes. Here it is.

  • 8088

    You can use an applescript for this (don't remember where I got this) -- I compile this to an application triggered by Quicksilver, to get immediate notification of what is playing when I want, keeping iTunes minimised at all times:

    growl

     tell application "GrowlHelperApp"
        -- Make a list of all the notification types
        -- that this script will ever send:
        set the allNotificationsList to {"iTunes Playing Track"}
        -- Make a list of the notifications
        -- that will be enabled by default.
        -- Those not enabled by default can be enabled later
        -- in the 'Applications' tab of the growl prefpane.
        set the enabledNotificationsList to {"iTunes Playing Track"}
        -- Register our script with growl.
        -- You can optionally (as here) set a default icon
        -- for this scripts notifications.
        register as application "Growl iTunes Notification" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "iTunes"
    
        set title_text to "Nothing playing"
        set body_text to ""
        set has_artwork to false
    
        tell application "iTunes"
            if player state is playing then
                set trck to current track
    
                if artworks of trck is not {} then
                    get artwork 1 of trck
                    set pic to data of result
                    set has_artwork to true
                end if
    
                get name of trck
                set title_text to result
    
                get time of trck
                set title_time to result
                set body_text to title_time & " =["
    
                get rating of trck
                set rate to result / 20
    
                repeat rate times
                    set body_text to body_text & " ❤ "
    
                end repeat
    
                get artist of trck
                set body_text to body_text & "]   ❧ " & result
    
                get album of trck
                set body_text to body_text & " ⇒ " & result
    
            end if
        end tell
    
        if has_artwork then
            notify with name "iTunes Playing Track" title title_text description body_text application name "Growl iTunes Notification" pictImage the pic
        else
            notify with name "iTunes Playing Track" title title_text description body_text application name "Growl iTunes Notification"
            "iTunesLibraryPlaylistIcon.icns"
        end if
    
    end tell