Bounce app icon in dock

Hi all, got an app that uses App.DockItem.Graphics to draw a counter on to the apps dock item (to let the user know that there are tasks that need attention within the app, similar to unread messages in Apple Mail) - I’d like, if possible, to make the icon bounce in the dock to grab the users attention when the counter is updated - is this possible via a declare or MBS?

Many thanks,
Dave.

Hello David,

This is from https://forums.realsoftware.com/viewtopic.php?f=21&t=45589&hilit=requestUserAttention

CONST NSCriticalRequest = 0  // until your app is activated or icon clicked
'CONST NSInformationalRequest = 10  // 1x

Declare Function NSClassFromString Lib kCocoaLib (aClassName as CFStringRef) as Ptr
Declare Function sharedApplication Lib kCocoaLib selector "sharedApplication" (aClassID as Ptr) as Ptr
Declare Sub requestUserAttention Lib kCocoaLib selector "requestUserAttention:" (aClassID as Ptr, aNSRequestUserAttentionType as Integer)

requestUserAttention(sharedApplication(NSClassFromString("NSApplication")), NSCriticalRequest)
4 Likes

Hi François,

Wow! Thank you so much.