MacOS – Hide Growl and Herald Notifications in VLC Fullscreen

growlmacosnotificationsvlc-media-player

It is annoying, when while watching film, I get growl notifications or mail notifications with Herald. I thought that one way to solve this is to set VLC's 'z-index' higher, than Growl's and Herald's notification boxes. Or maybe I can add hook to VLC going fullscreen/windowed, so it will disable both Growl and Herald for that time. Any advice?

If anyone interested, I wrote a small app some time ago and decided to post it here. It is a wrapper around any player (default is VLC, setting player is done by dropping player on app). When you open moveie with it, it quits GrowlHelperApp and HeraldAgent (note that it will not be possible to interact with Mail.app using mouse, and both agents will be launched back when player quits). Also, if movie is opened with fn pressed, volume and brightness are morphed to 85% (and morphed back when player quits).

Best Answer

Open the AppleScript Editor, save as application, when saving check the box "Stay Open". Use this new applescript application to launch the VLC application.

Description: It will launch VLC, turn off growl notifications, check every 2s to see if VLC has quit, if so it will turn growl notifications back on and then quit. As a bonus, it will use growl notifications to notify you when growl notifications will be turned on or off. Yeah, because that's the cool way to do it.

Not familiar with Herald, but this will give you a start. Just check to see what Herald's background process is and modify the script accordingly… or quit/relaunch the "Mail" process.

global Growl_was_Loaded
global VLC_is_Loaded

on open mediaFiles
    launchThis(mediaFiles)
    idle
end open

on run
    launchThis(null)
    idle
end run

on idle
    set x to isAppLoaded("VLC")
    if x and not VLC_is_Loaded then
        launchVLC()
    else if VLC_is_Loaded and not x then
        set VLC_is_Loaded to false
        if Growl_was_Loaded then
            tell application "GrowlHelperApp" to launch
            growl_notify("Growl notifications: ON")
        end if
        tell me to quit
    end if
    return 2 -- wait 2 seconds    
end idle

on launchThis(mFiles)
    set Growl_was_Loaded to isAppLoaded("GrowlHelperApp")
    set VLC_is_Loaded to isAppLoaded("VLC")
    launchVLC(mFiles)
end launchThis

on launchVLC(mf)
    if mf is null then
        tell application "VLC" to launch
    else
        tell application "VLC" to open file mf
    end if

    if Growl_was_Loaded then
        growl_notify("Growl notifications: OFF")
        delay 1
        tell application "GrowlHelperApp" to quit
    end if
    set VLC_is_Loaded to true
    tell application "VLC" to activate
end launchVLC

on isAppLoaded(app_name)
    tell application "System Events"
        set app_list to every application process whose name is app_name
        if the (count of app_list) > 0 then
            set x to true
        else
            set x to false
        end if
    end tell
    return x
 end isAppLoaded

 on growl_notify(msg)
    tell application "GrowlHelperApp"
        set the allNotificationsList to {"Growl Toggler"}
        register as application "Growl Toggler" all notifications allNotificationsList default notifications allNotificationsList
        notify with name "Growl Toggler" title msg description "" application name "Growl Toggler" icon of application "Automator"
    end tell
end growl_notify
Related Question