macOS, is my app active?

Ken Ray kray at
Sun Nov 24 02:25:57 EST 2019


I have a function that generally works with this AppleScript:

function stsGetFrontmostProcess
      put "tell app `System Events`" & cr & \
          "get (the name of every application process whose frontmost is true) as string" & cr & \
          "end tell" into tScript
      replace "`" with quote in tScript
      do tScript as AppleScript
      put the result into tResult
      replace quote with "" in tResult
      return tResult
end stsGetFrontmostProcess

Give that a try and see if it works for you.


> On Nov 23, 2019, at 6:24 AM, Klaus major-k via use-livecode <use-livecode at> wrote:
> Hi friends,
> can we check if our standalone is currently active, means in
> the "foreground" or if it is not active? Know what I mean?
> If yes, how can we do that? LC? AppleScript?
> I want to alert the user if the app is active, but not if the app 
> is not active.
> Thanks in advance!
> Best
> Klaus
> --
> Klaus Major
> klaus at
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list