macOSRequestUserAttention

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
Emily-Elizabeth
Posts: 101
Joined: Mon Jan 03, 2022 7:10 pm

macOSRequestUserAttention

Post by Emily-Elizabeth » Fri Jun 09, 2023 2:53 am

https://github.com/emily-elizabeth/LC_m ... rAttention

Have your dock icon notify the user that something needs their attention.
Usage: RequestUserAttention isCritical
where isCritical is a boolean; FALSE bounce the dock icon once, TRUE bounce the dock icon until the application is brought to the foreground

Code: Select all

on mouseUp pMouseButton
   send "moo" to me in 2 seconds
end mouseUp

command moo
   RequestUserAttention FALSE
end moo

PaulDaMacMan
Posts: 626
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: macOSRequestUserAttention

Post by PaulDaMacMan » Wed Jul 12, 2023 9:46 pm

Emily-Elizabeth wrote:
Fri Jun 09, 2023 2:53 am
https://github.com/emily-elizabeth/LC_m ... rAttention

Have your dock icon notify the user that something needs their attention.
Usage: RequestUserAttention isCritical
where isCritical is a boolean; FALSE bounce the dock icon once, TRUE bounce the dock icon until the application is brought to the foreground

Code: Select all

on mouseUp pMouseButton
   send "moo" to me in 2 seconds
end mouseUp

command moo
   RequestUserAttention FALSE
end moo
Great! I had the same method working in the OXT macOS tools library, but it's currently broken on macOS 12+ (need to update that handler because It used the older/ now-deprecated-by Apple API).
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”