[ANN] SSRequestUserAttention

Moderators: LCMark, LCfraser

Post Reply
shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

[ANN] SSRequestUserAttention

Post by shaosean » Sun Nov 12, 2017 4:44 pm

Here is my first LCB script.. It's Mac-only though.. It allows you to get the user's attention (make the dock icon bounce).. Syntax is very simple: RequestUserAttention(isCritical)

If you just want the dock icon to bounce once

Code: Select all

RequestUserAttention(FALSE)
If you want the dock icon to bounce until the application is brought to the foreground

Code: Select all

RequestUserAttention(TRUE)
To install this, download the attached file and save it somewhere (go and unzip it)
In LiveCode, go to the menu Tools > Extension Builder
In the new window, click the Folder icon (top right corner) and find the file
Once it loads in, click on the "Install" button (bottom of the window)

Now the library is installed to your Documents > My LiveCode > Extensions folder
You will need to do manual inclusions when building though.
Attachments
SSRequestUserAttention_1.0.0.zip
(991 Bytes) Downloaded 14 times

capellan
Posts: 409
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: [ANN] SSRequestUserAttention

Post by capellan » Tue Nov 14, 2017 12:55 am

This LCB script remembers me an external that you have published before.
I use Linux and Windows and could not compile this LCB script.
Are you going to publish more Mac-only LCB scripts?

Al

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: [ANN] SSRequestUserAttention

Post by shaosean » Tue Nov 14, 2017 8:13 am

capellan wrote:
Tue Nov 14, 2017 12:55 am
This LCB script remembers me an external that you have published before.
I use Linux and Windows and could not compile this LCB script.
Are you going to publish more Mac-only LCB scripts?

Al
This script is Mac-only, as only the macOS has that exact feature.. Yes, the other two OSes have similar features, and I would love to do the same for them, but I'm just learning this stuff and I am more familiar with the Mac than the other OSes so I will start with what I know and hopefully can branch out (but no promises)..

capellan
Posts: 409
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: [ANN] SSRequestUserAttention

Post by capellan » Tue Nov 14, 2017 7:39 pm

Many thanks for answering my request! :D
Hopefully, LCB scripts works just as well
with Linux and Windows.

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: [ANN] SSRequestUserAttention

Post by shaosean » Tue Nov 14, 2017 8:55 pm

I'll see what I can do. :-)

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

Re: [ANN] SSRequestUserAttention

Post by PaulDaMacMan » Thu Nov 16, 2017 12:00 am

Cool Thanks! There needs to be more LCB FFI examples!

Some people might not realize that this only works if LiveCode IDE or Standalone is in the background, if your stack is in the foreground then it does not do anything (nor should it).
To test it just put a

Code: Select all

wait 5 secs
line in front of the

Code: Select all

RequestUserAttention(isCritical)
or use a do as AppleScript... line and switch to the Finder.

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: [ANN] SSRequestUserAttention

Post by shaosean » Thu Nov 16, 2017 6:11 am

Thanks for pointing that out.. I'm not very good at docs, but you're right, it only works when your application is in the background.. If you use the RequestUserAttention(TRUE) method, the dock icon will keep bouncing until your application is brought to the foreground..

I'm attempting to do more LCB projects, but the docs are kind of like I wrote them ;) Right now I'm at a bit of a standstill as the sample code, posted in the other thread, doesn't seem to do anything, so that limits what I can do with working with the windows.. I have another piece of code that fails on the binding, so need to figure out what's up with that..

Post Reply

Return to “LiveCode Builder”