macOS, is my app active?

Klaus major-k klaus at major-k.de
Sat Nov 23 18:42:06 EST 2019


Hi JB,

> Am 24.11.2019 um 00:27 schrieb JB via use-livecode <use-livecode at lists.runrev.com>:
> 
> Hi Klaus,
> 
> I did that and got a error but by reformatting
> the code properly it worked.

what do you mean by "reformatting"?
I copied this from a TXT file and "pasted unformatted" into my field.

Still -> execution error

I suspect this is a permission thing, maybe I need to grant LC, and my later app,
permissions in the macOS Settings panel.

So the, little more complex, solution Trevor proposed suddenly looks a lot more appealing! :-D

> JB
> ...
>> 
>>> This is fld "IN" (your snippet):
>>> 
>>> tell application "System Events"
>>> set activeApp to name of first application process whose frontmost is true
>>> return activeApp
>>> end tell
>>> 
>>> on mouseUp
>>> do fld "IN" as "applescript"
>>> put the result into fld "OUT"
>>> end mouseUp
>>> 
>>> yields in fld "OUT":
>>> "Livecode-Community" or
>>> "LiveCode-Indy" or
>>> "LiveCode-Business"

Best

Klaus

--
Klaus Major
https://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list