Re: macOS, is my app active?

2019-11-25 Thread scott--- via use-livecode
It does work nicely from the IDE but as Trevor noted, the downside to using AppleScript in this case is that under newer version of OSX your compiled app will trigger a (one time) dialog asking to grant access to control “System Events.app” — Scott Morrow > On Nov 25, 2019, at 8:46 AM, Bob

Re: macOS, is my app active?

2019-11-25 Thread Bob Sneidar via use-livecode
on mouseUp put "tell application " & quote & "System Events" & quote & cr after tApplescript put "set activeApp to name of first application process whose frontmost is true" & cr after tApplescript put "return activeApp" & cr after tApplescript put "end tell" & cr after tApplescript

Re: macOS, is my app active?

2019-11-24 Thread Klaus major-k via use-livecode
Hi all, no matter what I tried with AppleScript, all I got was -> execution error So I took the time and tested Trevors solution and thanks to the idiot-proof instructions, this was a snap even for a LCB ignorant like moi! :-) Thanks again Trevor! And thanks to all for your suggestions! Best

Re: macOS, is my app active?

2019-11-23 Thread Ken Ray via use-livecode
Klaus, 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

Re: macOS, is my app active?

2019-11-23 Thread JB via use-livecode
Trevor, your code is written really nice! Thanks for the links and code. JB > On Nov 23, 2019, at 5:24 PM, Trevor DeVore via use-livecode > wrote: > > On Sat, Nov 23, 2019 at 7:09 PM scott--- via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> Trevor, >> >> Those directions were

Re: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 7:09 PM scott--- via use-livecode < use-livecode@lists.runrev.com> wrote: > Trevor, > > Those directions were awesome! I saw the security warning with the > AppleScript method. Your extension method avoided it. Thank you. You’re welcome Scott. -- Trevor DeVore

Re: macOS, is my app active?

2019-11-23 Thread scott--- via use-livecode
Trevor, Those directions were awesome! I saw the security warning with the AppleScript method. Your extension method avoided it. Thank you. — Scott Morrow Elementary Software (Now with 20% less chalk dust!) web https://elementarysoftware.com/ email sc...@elementarysoftware.com booth

Re: macOS, is my app active?

2019-11-23 Thread hh via use-livecode
> Klaus M. wrote: > Still -> execution error It works here in the IDE on MacOS 10.14.6 and 10.15.1 using LC 9.5.0. or LC 8.1.10. (I stopped using unstable LC versions a while ago). Did you try from the IDE? If it is from the standalone only you could also try to use osascript via shell: get

Re: macOS, is my app active?

2019-11-23 Thread JB via use-livecode
That is what I did too! Then I went to each line and deleted the white space until I ended up on the line above, after that I pressed return so the text went to its own line and it reformatted that line properly. This process should be done for each line. JB > On Nov 23, 2019, at 3:42 PM,

Re: macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
Hi JB, > Am 24.11.2019 um 00:27 schrieb JB via use-livecode > : > > 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

Re: macOS, is my app active?

2019-11-23 Thread JB via use-livecode
Hi Klaus, I did that and got a error but by reformatting the code properly it worked. JB > On Nov 23, 2019, at 1:04 PM, Klaus major-k via use-livecode > wrote: > > Hallo Hermann, > >> Am 23.11.2019 um 17:16 schrieb hh via use-livecode >> : >> >> MacOS 10.15.1 > > macOS 10.14.6 here, LC

Re: macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
Hi Trevor, > Am 23.11.2019 um 17:27 schrieb Trevor DeVore via use-livecode > : > On Sat, Nov 23, 2019 at 8:11 AM Klaus major-k via use-livecode < > use-livecode@lists.runrev.com> wrote: >> wow, lots of infos, thank you very much, but maybe a little overkill for >> me. >> >> It would suffice for

Re: macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
Hallo Hermann, > Am 23.11.2019 um 17:16 schrieb hh via use-livecode > : > > MacOS 10.15.1 macOS 10.14.6 here, LC 9.5.1 rc1 > This is fld "IN" (your snippet): > > tell application "System Events" > set activeApp to name of first application process whose frontmost is true > return activeApp

Re: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 8:11 AM Klaus major-k via use-livecode < use-livecode@lists.runrev.com> wrote: > > wow, lots of infos, thank you very much, but maybe a little overkill for > me. > > It would suffice for me to get this little snippet to work: >

Re: macOS, is my app active?

2019-11-23 Thread hh via use-livecode
MacOS 10.15.1 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":

Re: macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
Hi Trevor, > Am 23.11.2019 um 15:06 schrieb Trevor DeVore via use-livecode > : > > On Sat, Nov 23, 2019 at 6:24 AM Klaus major-k via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> Hi friends, >> >> can we check if our standalone is currently active, means in >> the "foreground"

Re: macOS, is my app active?

2019-11-23 Thread Trevor DeVore via use-livecode
On Sat, Nov 23, 2019 at 6:24 AM Klaus major-k via use-livecode < use-livecode@lists.runrev.com> 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

Re: macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
Hi all, > Am 23.11.2019 um 13:24 schrieb Klaus major-k via use-livecode > : > > 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

macOS, is my app active?

2019-11-23 Thread Klaus major-k via use-livecode
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 --