Re: Active window and mouse location
As a workaround, making it a system window, then immediately making it a topLevel window should get around your issue. Not sure why it behaves the way it does. Going to a stack should make the stack the topStack, and only other stacks set as modal or system windows would override that behavior. Bob S > On May 13, 2018, at 07:26 , Douglas Ruisaard via use-livecode > wrote: > > Since I do not create the stack as a "modal stack" (a command I didn't even > know existed... again, thanks for THAT), then does that make my card (only > one in the app) a "system" window? After read the doc's on "modal stack", I > doubt that I want my stack to become "modal"... even temporarily. > > What I seek is that window that "remains on top" *is* the LC card's window (I > only have one card in this app)... but this statement is qualified as > explained below. > > When I "leave" the LC window to perform an action on another window (e.g. > Notepad), the Notepad window become the active window. What I want (and > achieve using AutoHotKey) is, after placing a section of text from another > window (Notepad, Outlook, Excel, etc.)into the clipboard (via ^C, double > click, etc.), my LC card's window becomes the top-most, active window > AUTOMATICALLY. Of course I could MANUALLY "dig it out" from behind any > overlaying windows but I'm much too lazy to do THAT. > > LC happily (and impressively) "sees" the "new" clipboard data in a "timing > loop", and inserts it into my LC processing. What I am seeking, in an LC > native procedure, is for the LC card's window to become the top-most window. > I DO NOT want to make my LC window the top-most ALL THE TIME, as the " set > the systemwindow of stack "stackname" to true" does... just re-emerge as the > top-most window when I want it to. > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
I don't think any OS allows an app to insert itself into the user's work flow like that. Even your own solution requires you to specify it via a hot key. Usually we use the native version of interapp communication, which on Mac is applesccript and on Windows VB. Or you could see if there's an equivalent shell command, there probably is. You can run shell commands from LC. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On May 13, 2018 9:29:01 AM Douglas Ruisaard via use-livecode wrote: Since I do not create the stack as a "modal stack" (a command I didn't even know existed... again, thanks for THAT), then does that make my card (only one in the app) a "system" window? After read the doc's on "modal stack", I doubt that I want my stack to become "modal"... even temporarily. What I seek is that window that "remains on top" *is* the LC card's window (I only have one card in this app)... but this statement is qualified as explained below. When I "leave" the LC window to perform an action on another window (e.g. Notepad), the Notepad window become the active window. What I want (and achieve using AutoHotKey) is, after placing a section of text from another window (Notepad, Outlook, Excel, etc.)into the clipboard (via ^C, double click, etc.), my LC card's window becomes the top-most, active window AUTOMATICALLY. Of course I could MANUALLY "dig it out" from behind any overlaying windows but I'm much too lazy to do THAT. LC happily (and impressively) "sees" the "new" clipboard data in a "timing loop", and inserts it into my LC processing. What I am seeking, in an LC native procedure, is for the LC card's window to become the top-most window. I DO NOT want to make my LC window the top-most ALL THE TIME, as the " set the systemwindow of stack "stackname" to true" does... just re-emerge as the top-most window when I want it to. Douglas Ruisaard Trilogy Software (250) 573-3935 Is the window that remains on top a modal or system window? Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Since I do not create the stack as a "modal stack" (a command I didn't even know existed... again, thanks for THAT), then does that make my card (only one in the app) a "system" window? After read the doc's on "modal stack", I doubt that I want my stack to become "modal"... even temporarily. What I seek is that window that "remains on top" *is* the LC card's window (I only have one card in this app)... but this statement is qualified as explained below. When I "leave" the LC window to perform an action on another window (e.g. Notepad), the Notepad window become the active window. What I want (and achieve using AutoHotKey) is, after placing a section of text from another window (Notepad, Outlook, Excel, etc.)into the clipboard (via ^C, double click, etc.), my LC card's window becomes the top-most, active window AUTOMATICALLY. Of course I could MANUALLY "dig it out" from behind any overlaying windows but I'm much too lazy to do THAT. LC happily (and impressively) "sees" the "new" clipboard data in a "timing loop", and inserts it into my LC processing. What I am seeking, in an LC native procedure, is for the LC card's window to become the top-most window. I DO NOT want to make my LC window the top-most ALL THE TIME, as the " set the systemwindow of stack "stackname" to true" does... just re-emerge as the top-most window when I want it to. Douglas Ruisaard Trilogy Software (250) 573-3935 > > Is the window that remains on top a modal or system window? > > Bob S > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Is the window that remains on top a modal or system window? Bob S > On May 11, 2018, at 08:09 , Douglas Ruisaard via use-livecode > wrote: > > no apologies necessary... you got it completely right!... Unfortunately your > idea doesn't work in Windows 7 and/or in LC v 8.1.9 (I've removed v9 for the > time being, so it isn't available to try your idea). > > The LC window remains "behind" any other window which I have made the > top-most. Luckily, this version of my utility is for *my* own use ... the > user one doesn't need this sort of functionality... and, for the time being, > isn't deployed to the Mac/Apple environments at all. > > Thanks again .. I enjoy learning about such alternatives... likely, they will > come into use in some future project! > > Cheers! > Doug > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
no apologies necessary... you got it completely right!... Unfortunately your idea doesn't work in Windows 7 and/or in LC v 8.1.9 (I've removed v9 for the time being, so it isn't available to try your idea). The LC window remains "behind" any other window which I have made the top-most. Luckily, this version of my utility is for *my* own use ... the user one doesn't need this sort of functionality... and, for the time being, isn't deployed to the Mac/Apple environments at all. Thanks again .. I enjoy learning about such alternatives... likely, they will come into use in some future project! Cheers! Doug Douglas Ruisaard Trilogy Software (250) 573-3935 > > Apologies if I'm misunderstanding the problem or if someone already > suggested this, but won't the stack come to the front if you just say > "go to stack tMyStack" ?? Seems to me that would make it the topStack, > which is apparently what you want (as I read it). > > Or if the stack is a mainStack, you could say "launch document > tMyStackFilepath" and the same thing would happen. > > Another simple two-line approach: > > push current card of stack tTheOneBehind > pop card > > The push/pop approach should work in any LC version. (I'm working in LC 9) > > Thanks - > Phil Davis > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi Douglas, Apologies if I'm misunderstanding the problem or if someone already suggested this, but won't the stack come to the front if you just say "go to stack tMyStack" ? Seems to me that would make it the topStack, which is apparently what you want (as I read it). Or if the stack is a mainStack, you could say "launch document tMyStackFilepath" and the same thing would happen. Another simple two-line approach: push current card of stack tTheOneBehind pop card The push/pop approach should work in any LC version. (I'm working in LC 9) Thanks - Phil Davis On 5/9/18 2:34 PM, Douglas Ruisaard via use-livecode wrote: Thanks, Mike... but this doesn't make my LC screen active... it does flicker it but leaves it in buried under the top window. I'll check out those links, Lagi... thanks for the research Thanks to Bob und Klaus for the "Launch" suggestion ... however, I don't want to open, launch or startup anything, I just need the LC window which is displaying the card processing to become the top-most window ... so I'm not sure exactly what I would use as the "document" in the launch command. I will, however, keep this in mind for other purposes. As expected, a VERY simple, one-line script to AutoHotKey did the trick... which can be compiled into a standalone executable... and then shell'd to. Only thing is that it isn't cross-platform... windows only. If I find the time, I'll try Bob's suggestion for the Apple. Many Thanks! Doug Douglas Ruisaard Trilogy Software (250) 573-3935 While the solution is not perfect, you can have your script set the systemwindow of stack "stackname" to true wait 1 tick set the systemwindow of stack "stackname" to false (Saw this on the forums at one time or another, think the thanks go to Lagi) The only negative of this method is the flicker as it goes system, then back again. -- ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Go card/stack?? Bob S > On May 10, 2018, at 01:44 , Klaus major-k via use-livecode > wrote: > >> Am 09.05.2018 um 23:34 schrieb Douglas Ruisaard via use-livecode >> : >> >> Thanks, Mike... but this doesn't make my LC screen active... it does flicker >> it but leaves it in buried under the top window. >> I'll check out those links, Lagi... thanks for the research ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Oh, one other option for windows would be vbscript. Unfortunately, I don't think you can "do myScript as vbscript" because (according to the dictionary) the required objects aren't available to livecode using that method. You can however, create a .vbs file with a script that should be able to bring your app to the front. Put the file somewhere accessible, and use launch document to run it. There are threads on this in the forum, I'll re-locate them if you are interested in the idea. On Thu, May 10, 2018 at 9:14 AM, Mike Bonner wrote: > Hmm Just a curiosity question to further the experiment if you don't > mind.. I had been thinking you could use the "click" command to bring > things to front, but if its not in front you can't do that. So out of > curiosity.. If you set it to a system window so that its in front of > everything, and then use the click command (click at x,y) then > un-systemwindow it, does it retain focus? I'd test here, but for some > reason it behaves differently for me. (It sounds like your autohotkey > answer is still the better option.) > > On Thu, May 10, 2018 at 8:13 AM, Douglas Ruisaard via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> More specifically, if I increase the "wait", the desired windows comes to >> the foreground, the wait expires and then it "retreats" back behind the >> other window(s) to its original placement. Neat trick for a timed "pop-up" >> window. Without the "false" reset, the window remains as the foreground >> window FOREVER... blocking any other windows or pop-up (e.g. "answer") >> windows if they appear behind this foreground window. THAT in turn means >> that you have to kill the foreground window in order to proceed so >> don't try this trick at home, kids! >> >> Nonetheless, an interesting command.. one which I will consider using in >> another place and time. >> >> Thanks again, >> Doug >> >> Douglas Ruisaard >> Trilogy Software >> (250) 573-3935 >> >> > Hmm. Not sure whats up then. doing the systemwindow trick pops things >> to the front for me from behind >> > a browser of whatever happens to be in front, so no clue why it won't >> work for you. (unless the >> > window that it is behind is a system window itself) >> > >> > On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode < >> use-livecode@lists.runrev.com> >> > wrote: >> > >> > > Thanks, Mike... but this doesn't make my LC screen active... it does >> > > flicker it but leaves it in buried under the top window. >> > > >> > > I'll check out those links, Lagi... thanks for the research >> > > >> > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I >> > > don't want to open, launch or startup anything, I just need the LC >> > > window which is displaying the card processing to become the top-most >> > > window ... so I'm not sure exactly what I would use as the "document" >> in the launch command. >> > > I will, however, keep this in mind for other purposes. >> > > >> > > As expected, a VERY simple, one-line script to AutoHotKey did the >> trick... >> > > which can be compiled into a standalone executable... and then >> shell'd to. >> > > Only thing is that it isn't cross-platform... windows only. If I find >> > > the time, I'll try Bob's suggestion for the Apple. >> > > >> > > Many Thanks! >> > > Doug >> > > >> > > >> > > Douglas Ruisaard >> > > Trilogy Software >> > > (250) 573-3935 >> > > >> > > > >> > > > While the solution is not perfect, you can have your script set the >> > > > systemwindow of stack "stackname" to true wait 1 tick set the >> > > > systemwindow of stack "stackname" to false >> > > > >> > > > (Saw this on the forums at one time or another, think the thanks go >> > > > to >> > > Lagi) >> > > > >> > > > The only negative of this method is the flicker as it goes system, >> > > > then back again. >> > > > >> > > > >> > > > -- >> > > > >> > > > >> > > >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hmm Just a curiosity question to further the experiment if you don't mind.. I had been thinking you could use the "click" command to bring things to front, but if its not in front you can't do that. So out of curiosity.. If you set it to a system window so that its in front of everything, and then use the click command (click at x,y) then un-systemwindow it, does it retain focus? I'd test here, but for some reason it behaves differently for me. (It sounds like your autohotkey answer is still the better option.) On Thu, May 10, 2018 at 8:13 AM, Douglas Ruisaard via use-livecode < use-livecode@lists.runrev.com> wrote: > More specifically, if I increase the "wait", the desired windows comes to > the foreground, the wait expires and then it "retreats" back behind the > other window(s) to its original placement. Neat trick for a timed "pop-up" > window. Without the "false" reset, the window remains as the foreground > window FOREVER... blocking any other windows or pop-up (e.g. "answer") > windows if they appear behind this foreground window. THAT in turn means > that you have to kill the foreground window in order to proceed so > don't try this trick at home, kids! > > Nonetheless, an interesting command.. one which I will consider using in > another place and time. > > Thanks again, > Doug > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 > > > Hmm. Not sure whats up then. doing the systemwindow trick pops things > to the front for me from behind > > a browser of whatever happens to be in front, so no clue why it won't > work for you. (unless the > > window that it is behind is a system window itself) > > > > On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode < > use-livecode@lists.runrev.com> > > wrote: > > > > > Thanks, Mike... but this doesn't make my LC screen active... it does > > > flicker it but leaves it in buried under the top window. > > > > > > I'll check out those links, Lagi... thanks for the research > > > > > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I > > > don't want to open, launch or startup anything, I just need the LC > > > window which is displaying the card processing to become the top-most > > > window ... so I'm not sure exactly what I would use as the "document" > in the launch command. > > > I will, however, keep this in mind for other purposes. > > > > > > As expected, a VERY simple, one-line script to AutoHotKey did the > trick... > > > which can be compiled into a standalone executable... and then shell'd > to. > > > Only thing is that it isn't cross-platform... windows only. If I find > > > the time, I'll try Bob's suggestion for the Apple. > > > > > > Many Thanks! > > > Doug > > > > > > > > > Douglas Ruisaard > > > Trilogy Software > > > (250) 573-3935 > > > > > > > > > > > While the solution is not perfect, you can have your script set the > > > > systemwindow of stack "stackname" to true wait 1 tick set the > > > > systemwindow of stack "stackname" to false > > > > > > > > (Saw this on the forums at one time or another, think the thanks go > > > > to > > > Lagi) > > > > > > > > The only negative of this method is the flicker as it goes system, > > > > then back again. > > > > > > > > > > > > -- > > > > > > > > > > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
More specifically, if I increase the "wait", the desired windows comes to the foreground, the wait expires and then it "retreats" back behind the other window(s) to its original placement. Neat trick for a timed "pop-up" window. Without the "false" reset, the window remains as the foreground window FOREVER... blocking any other windows or pop-up (e.g. "answer") windows if they appear behind this foreground window. THAT in turn means that you have to kill the foreground window in order to proceed so don't try this trick at home, kids! Nonetheless, an interesting command.. one which I will consider using in another place and time. Thanks again, Doug Douglas Ruisaard Trilogy Software (250) 573-3935 > Hmm. Not sure whats up then. doing the systemwindow trick pops things to the > front for me from behind > a browser of whatever happens to be in front, so no clue why it won't work > for you. (unless the > window that it is behind is a system window itself) > > On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode < > use-livecode@lists.runrev.com> > wrote: > > > Thanks, Mike... but this doesn't make my LC screen active... it does > > flicker it but leaves it in buried under the top window. > > > > I'll check out those links, Lagi... thanks for the research > > > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I > > don't want to open, launch or startup anything, I just need the LC > > window which is displaying the card processing to become the top-most > > window ... so I'm not sure exactly what I would use as the "document" in > > the launch command. > > I will, however, keep this in mind for other purposes. > > > > As expected, a VERY simple, one-line script to AutoHotKey did the trick... > > which can be compiled into a standalone executable... and then shell'd to. > > Only thing is that it isn't cross-platform... windows only. If I find > > the time, I'll try Bob's suggestion for the Apple. > > > > Many Thanks! > > Doug > > > > > > Douglas Ruisaard > > Trilogy Software > > (250) 573-3935 > > > > > > > > While the solution is not perfect, you can have your script set the > > > systemwindow of stack "stackname" to true wait 1 tick set the > > > systemwindow of stack "stackname" to false > > > > > > (Saw this on the forums at one time or another, think the thanks go > > > to > > Lagi) > > > > > > The only negative of this method is the flicker as it goes system, > > > then back again. > > > > > > > > > -- > > > > > > > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi Doug, > Am 09.05.2018 um 23:34 schrieb Douglas Ruisaard via use-livecode > : > > Thanks, Mike... but this doesn't make my LC screen active... it does flicker > it but leaves it in buried under the top window. > I'll check out those links, Lagi... thanks for the research > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I don't want > to open, launch or startup anything, I just need the LC window which is > displaying the card processing to become the top-most window ... so I'm not > sure exactly what I would use as the "document" in the launch command. I > will, however, keep this in mind for other purposes. the "document" in my script is the folder itself! So this is just like double-clicking the folder in the Finder/Explorer! > As expected, a VERY simple, one-line script to AutoHotKey did the trick... > which can be compiled into a standalone executable... and then shell'd to. > Only thing is that it isn't cross-platform... windows only. If I find the > time, I'll try Bob's suggestion for the Apple. > > Many Thanks! > Doug Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hmm. Not sure whats up then. doing the systemwindow trick pops things to the front for me from behind a browser of whatever happens to be in front, so no clue why it won't work for you. (unless the window that it is behind is a system window itself) On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode < use-livecode@lists.runrev.com> wrote: > Thanks, Mike... but this doesn't make my LC screen active... it does > flicker it but leaves it in buried under the top window. > > I'll check out those links, Lagi... thanks for the research > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I don't > want to open, launch or startup anything, I just need the LC window which > is displaying the card processing to become the top-most window ... so I'm > not sure exactly what I would use as the "document" in the launch command. > I will, however, keep this in mind for other purposes. > > As expected, a VERY simple, one-line script to AutoHotKey did the trick... > which can be compiled into a standalone executable... and then shell'd to. > Only thing is that it isn't cross-platform... windows only. If I find the > time, I'll try Bob's suggestion for the Apple. > > Many Thanks! > Doug > > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 > > > > > While the solution is not perfect, you can have your script > > set the systemwindow of stack "stackname" to true > > wait 1 tick > > set the systemwindow of stack "stackname" to false > > > > (Saw this on the forums at one time or another, think the thanks go to > Lagi) > > > > The only negative of this method is the flicker as it goes system, then > > back again. > > > > > > -- > > > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Thanks, Mike... but this doesn't make my LC screen active... it does flicker it but leaves it in buried under the top window. I'll check out those links, Lagi... thanks for the research Thanks to Bob und Klaus for the "Launch" suggestion ... however, I don't want to open, launch or startup anything, I just need the LC window which is displaying the card processing to become the top-most window ... so I'm not sure exactly what I would use as the "document" in the launch command. I will, however, keep this in mind for other purposes. As expected, a VERY simple, one-line script to AutoHotKey did the trick... which can be compiled into a standalone executable... and then shell'd to. Only thing is that it isn't cross-platform... windows only. If I find the time, I'll try Bob's suggestion for the Apple. Many Thanks! Doug Douglas Ruisaard Trilogy Software (250) 573-3935 > > While the solution is not perfect, you can have your script > set the systemwindow of stack "stackname" to true > wait 1 tick > set the systemwindow of stack "stackname" to false > > (Saw this on the forums at one time or another, think the thanks go to Lagi) > > The only negative of this method is the flicker as it goes system, then > back again. > > > -- > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi Bob, > Am 09.05.2018 um 19:22 schrieb Bob Sneidar via use-livecode > : > > Oh, no kidding! No! :-) > I read the dictionary, and it gives no indication this will work with folders > as well as files!!! > I use launch document for files as well. One day I just tried it and it worked! Believe me, I was as astonished as you are now! :-D > And I thought I was being clever! > I guess this means I cannot absolutely trust the dictionary anymore! LOL! You can, but it may not tell your the WHOLE truth! ;-) > Bob S > >> On May 9, 2018, at 10:14 , Klaus major-k via use-livecode >> wrote: >> Or maybe this slightly shorter verison: >> ... >> launch document tPath >> ... >> >> :-D Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Oh, no kidding! I read the dictionary, and it gives no indication this will work with folders as well as files!!! I use launch document for files as well. And I thought I was being clever! I guess this means I cannot absolutely trust the dictionary anymore! LOL! Bob S > On May 9, 2018, at 10:14 , Klaus major-k via use-livecode > wrote: > > Or maybe this slightly shorter verison: > ... > launch document tPath > ... > > :-D ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi Bob, > Am 09.05.2018 um 19:05 schrieb Bob Sneidar via use-livecode > : > > Here is what I do and it works a peach. Assuming tPath is a valid path to a > folder: > > if tPlatform contains "Win" then > replace "/" with "\" in tPath > put "explorer " & quote & tpath & quote into theCmd > put shell(theCmd) into theResult > else > put "property the_path : " & quote & tPath & quote & cr into theCmd > put "set the_folder to (POSIX file the_path) as alias" & cr after theCmd > put "tell application " & quote & "finder" & quote & cr after theCmd > put "activate" & cr after theCmd > put "reveal the_folder" & cr after theCmd > put "end tell" & cr after theCmd > do theCmd as appleScript > end if > > This should probably also be in the master library. Or maybe this slightly shorter verison: ... launch document tPath ... :-D > Bob S > >> On May 9, 2018, at 08:32 , Douglas Ruisaard via use-livecode >> wrote: >> >> Thanks, as always, for the responses. Getting old means you forget about the >> differences between Commands and Functions... but anyway >> My MAIN question was whether there was a way to get LC to make a desktop >> window THE active, top-most window... next necessarily the LC's window (in >> my case) but ANY window for that matter. Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Here is what I do and it works a peach. Assuming tPath is a valid path to a folder: if tPlatform contains "Win" then replace "/" with "\" in tPath put "explorer " & quote & tpath & quote into theCmd put shell(theCmd) into theResult else put "property the_path : " & quote & tPath & quote & cr into theCmd put "set the_folder to (POSIX file the_path) as alias" & cr after theCmd put "tell application " & quote & "finder" & quote & cr after theCmd put "activate" & cr after theCmd put "reveal the_folder" & cr after theCmd put "end tell" & cr after theCmd do theCmd as appleScript end if This should probably also be in the master library. Bob S > On May 9, 2018, at 08:32 , Douglas Ruisaard via use-livecode > wrote: > > Thanks, as always, for the responses. Getting old means you forget about the > differences between Commands and Functions... but anyway > My MAIN question was whether there was a way to get LC to make a desktop > window THE active, top-most window... next necessarily the LC's window (in my > case) but ANY window for that matter. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi Doug, Could this thread be helpful? http://forums.livecode.com/viewtopic.php?f=7&t=30984 and this lesson http://lessons.livecode.com/m/2592/l/125868-searching-for- an-open-window-by-title Only for Livecode "windows"/stacks though Failing that, using FFI with C would do it You need to get the handle of the window via enumwindows (abou 10 ways of doing it) https://msdn.microsoft.com/en-us/library/windows/desktop/ ms633497.aspx then call https://msdn.microsoft.com/en-us/library/windows/desktop/ ms632673(v=vs.85).aspx This pdf (aboutvisual foxpro winapi access ) give all manner of calls and calling structures which should help with FFI - I'm going to have to have a go at FFI soon. https://www.dropbox.com/s/a0sa3q8vu3ctf3o/E-WAPI.pdf?dl=0 I did this with a Visual Foxpro routine over a decade ago - but I've been to bed since then so hopefully one of the clever cloggs on here could do this to give us all a good template example for accessing windows apis via FFI and C - Go on mark/panos/Ali - in between bites of your sandwiches. a 15 minutes slot on LC Global? Regards Lagi On 9 May 2018 at 16:32, Douglas Ruisaard via use-livecode < use-livecode@lists.runrev.com> wrote: > Thanks, as always, for the responses. Getting old means you forget about > the differences between Commands and Functions... but anyway > My MAIN question was whether there was a way to get LC to make a desktop > window THE active, top-most window... next necessarily the LC's window (in > my case) but ANY window for that matter. > > I'll be using a shell command out to an AUTOHOTKEY compiled script to > switch to the desired desktop window but was wondering if there was a > native LC way to do so. BTW, anyone who hasn't heard or tried AutoHotKey, > should do themselves a huge favor (favour in the British colonies) and > explore its capabilities... which, I assure you, are myriad on Windows > platforms. There are similar tools I have NOT explored available on the > Mac. > > However, before this thread evolves into a discussion about external > scripting tools; please, if possible, let me know if anyone knows a LC-way > to active a specific window on the desktop. ... ps... I am completely > ignorant (and likely to remain so) regarding Java... so, if that is an > option, I'd need a "seed" scripting suggestion as to how to start. > > Cheers! > Doug > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 > > > In Windows 7, LC v8.1.9 > > Is there a way to make an LC "window" the active / top window on the > desktop after making another > > window on the desktop active? I have an app which allows me to copy a > portion of text from, say, a > > Notepad window, into the clipboard. A timed loop within my LC script > then pulls the clipboard text > > into an LC field and starts an analysis of the contents of that field. > THAT works great. But then I > > need the LC window to become the active window after the analysis is > done and displayed on my LC > > window, so I can manipulate the various controls I have on it. > > > > Of course I can "manually" click on the LC window to activate it but I > was wondering if there is a way > > to do so in LC script. I've tried "focus on field xxx" (where xxx is a > field in my displayed LC > > window), "set the screenMouseLoc to the loc of this stack", "go to this > stack" and a variety of "click > > at" commands... none of these make the LC window the top active window > on the desktop. The Notepad > > (or whatever) window stays as the top, active window. > > > > On a somewhat related note, how do you "set" the mouse location within > an LC window? I know and use > > the "set the screenMouseLoc to the loc of this stack" but an equivalent > "set the MouseLoc to the loc > > of this stack" or "set the mouseLoc to "650,420"" generates an error of > "Properties: token is not a > > property) near "mouseLoc", char 10" when trying to save the code. Seems > odd that I have to use FULL > > screen coordinates to set the mouse location rather than relative ones > to the stack. > > > > Douglas Ruisaard > > Trilogy Software > > (250) 573-3935 > > > > > The "screenMouseLoc" is a property, but the "mouseLoc" is a > > function.You cannot set a function. > > > > > > Why this was wrought this way is anybody's guess. > > > > If memory serves mouseLoc was implemented as a function for > compatibility with HyperCard, which > > offered no way to move the mouse cursor. > > > > When the opportunity came up to make a global version, it seems the > choice to make that one a property > > was simply because a property is more useful, allowing both getting and > setting. > > > > -- > > Richard Gaskin > > Fourth World Systems > > Software Design and Development for the Desktop, Mobile, and the Web > > > > ambassa...@fourthworld.comhttp://www.FourthWorld.com > > > > > > > __
Re: Active window and mouse location
While the solution is not perfect, you can have your script set the systemwindow of stack "stackname" to true wait 1 tick set the systemwindow of stack "stackname" to false (Saw this on the forums at one time or another, think the thanks go to Lagi) The only negative of this method is the flicker as it goes system, then back again. On Wed, May 9, 2018 at 9:32 AM, Douglas Ruisaard via use-livecode < use-livecode@lists.runrev.com> wrote: > Thanks, as always, for the responses. Getting old means you forget about > the differences between Commands and Functions... but anyway > My MAIN question was whether there was a way to get LC to make a desktop > window THE active, top-most window... next necessarily the LC's window (in > my case) but ANY window for that matter. > > I'll be using a shell command out to an AUTOHOTKEY compiled script to > switch to the desired desktop window but was wondering if there was a > native LC way to do so. BTW, anyone who hasn't heard or tried AutoHotKey, > should do themselves a huge favor (favour in the British colonies) and > explore its capabilities... which, I assure you, are myriad on Windows > platforms. There are similar tools I have NOT explored available on the > Mac. > > However, before this thread evolves into a discussion about external > scripting tools; please, if possible, let me know if anyone knows a LC-way > to active a specific window on the desktop. ... ps... I am completely > ignorant (and likely to remain so) regarding Java... so, if that is an > option, I'd need a "seed" scripting suggestion as to how to start. > > Cheers! > Doug > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 > > > In Windows 7, LC v8.1.9 > > Is there a way to make an LC "window" the active / top window on the > desktop after making another > > window on the desktop active? I have an app which allows me to copy a > portion of text from, say, a > > Notepad window, into the clipboard. A timed loop within my LC script > then pulls the clipboard text > > into an LC field and starts an analysis of the contents of that field. > THAT works great. But then I > > need the LC window to become the active window after the analysis is > done and displayed on my LC > > window, so I can manipulate the various controls I have on it. > > > > Of course I can "manually" click on the LC window to activate it but I > was wondering if there is a way > > to do so in LC script. I've tried "focus on field xxx" (where xxx is a > field in my displayed LC > > window), "set the screenMouseLoc to the loc of this stack", "go to this > stack" and a variety of "click > > at" commands... none of these make the LC window the top active window > on the desktop. The Notepad > > (or whatever) window stays as the top, active window. > > > > On a somewhat related note, how do you "set" the mouse location within > an LC window? I know and use > > the "set the screenMouseLoc to the loc of this stack" but an equivalent > "set the MouseLoc to the loc > > of this stack" or "set the mouseLoc to "650,420"" generates an error of > "Properties: token is not a > > property) near "mouseLoc", char 10" when trying to save the code. Seems > odd that I have to use FULL > > screen coordinates to set the mouse location rather than relative ones > to the stack. > > > > Douglas Ruisaard > > Trilogy Software > > (250) 573-3935 > > > > > The "screenMouseLoc" is a property, but the "mouseLoc" is a > > function.You cannot set a function. > > > > > > Why this was wrought this way is anybody's guess. > > > > If memory serves mouseLoc was implemented as a function for > compatibility with HyperCard, which > > offered no way to move the mouse cursor. > > > > When the opportunity came up to make a global version, it seems the > choice to make that one a property > > was simply because a property is more useful, allowing both getting and > setting. > > > > -- > > Richard Gaskin > > Fourth World Systems > > Software Design and Development for the Desktop, Mobile, and the Web > > > > ambassa...@fourthworld.comhttp://www.FourthWorld.com > > > > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Thanks, as always, for the responses. Getting old means you forget about the differences between Commands and Functions... but anyway My MAIN question was whether there was a way to get LC to make a desktop window THE active, top-most window... next necessarily the LC's window (in my case) but ANY window for that matter. I'll be using a shell command out to an AUTOHOTKEY compiled script to switch to the desired desktop window but was wondering if there was a native LC way to do so. BTW, anyone who hasn't heard or tried AutoHotKey, should do themselves a huge favor (favour in the British colonies) and explore its capabilities... which, I assure you, are myriad on Windows platforms. There are similar tools I have NOT explored available on the Mac. However, before this thread evolves into a discussion about external scripting tools; please, if possible, let me know if anyone knows a LC-way to active a specific window on the desktop. ... ps... I am completely ignorant (and likely to remain so) regarding Java... so, if that is an option, I'd need a "seed" scripting suggestion as to how to start. Cheers! Doug Douglas Ruisaard Trilogy Software (250) 573-3935 > In Windows 7, LC v8.1.9 > Is there a way to make an LC "window" the active / top window on the desktop > after making another > window on the desktop active? I have an app which allows me to copy a > portion of text from, say, a > Notepad window, into the clipboard. A timed loop within my LC script then > pulls the clipboard text > into an LC field and starts an analysis of the contents of that field. THAT > works great. But then I > need the LC window to become the active window after the analysis is done and > displayed on my LC > window, so I can manipulate the various controls I have on it. > > Of course I can "manually" click on the LC window to activate it but I was > wondering if there is a way > to do so in LC script. I've tried "focus on field xxx" (where xxx is a field > in my displayed LC > window), "set the screenMouseLoc to the loc of this stack", "go to this > stack" and a variety of "click > at" commands... none of these make the LC window the top active window on the > desktop. The Notepad > (or whatever) window stays as the top, active window. > > On a somewhat related note, how do you "set" the mouse location within an LC > window? I know and use > the "set the screenMouseLoc to the loc of this stack" but an equivalent "set > the MouseLoc to the loc > of this stack" or "set the mouseLoc to "650,420"" generates an error of > "Properties: token is not a > property) near "mouseLoc", char 10" when trying to save the code. Seems odd > that I have to use FULL > screen coordinates to set the mouse location rather than relative ones to the > stack. > > Douglas Ruisaard > Trilogy Software > (250) 573-3935 > > > The "screenMouseLoc" is a property, but the "mouseLoc" is a > > function.You cannot set a function. > > > > Why this was wrought this way is anybody's guess. > > If memory serves mouseLoc was implemented as a function for compatibility > with HyperCard, which > offered no way to move the mouse cursor. > > When the opportunity came up to make a global version, it seems the choice to > make that one a property > was simply because a property is more useful, allowing both getting and > setting. > > -- > Richard Gaskin > Fourth World Systems > Software Design and Development for the Desktop, Mobile, and the Web > > ambassa...@fourthworld.comhttp://www.FourthWorld.com > > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
On 5/8/18 12:48 PM, Douglas Ruisaard via use-livecode wrote: On a somewhat related note, how do you "set" the mouse location within an LC window? I know and use the "set the screenMouseLoc to the loc of this stack" but an equivalent "set the MouseLoc to the loc of this stack" or "set the mouseLoc to "650,420"" generates an error of "Properties: token is not a property) near "mouseLoc", char 10" when trying to save the code. Seems odd that I have to use FULL screen coordinates to set the mouse location rather than relative ones to the stack. The globalLoc function will translate the coordinates for you: set the screenMouseLoc to globalLoc(cardX,cardY) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
dunbarx wrote: > The "screenMouseLoc" is a property, but the "mouseLoc" is a > function.You cannot set a function. > > Why this was wrought this way is anybody's guess. If memory serves mouseLoc was implemented as a function for compatibility with HyperCard, which offered no way to move the mouse cursor. When the opportunity came up to make a global version, it seems the choice to make that one a property was simply because a property is more useful, allowing both getting and setting. -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Active window and mouse location
Hi. The "screenMouseLoc" is a property, but the "mouseLoc" is a function.You cannot set a function. Why this was wrought this way is anybody's guess. I recommend that you make a library gadget that automatically takes the open LC window properties and does the math. Then your "newMouseLoc" property can be local to the window. Craig Newman -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Active window and mouse location
In Windows 7, LC v8.1.9 Is there a way to make an LC "window" the active / top window on the desktop after making another window on the desktop active? I have an app which allows me to copy a portion of text from, say, a Notepad window, into the clipboard. A timed loop within my LC script then pulls the clipboard text into an LC field and starts an analysis of the contents of that field. THAT works great. But then I need the LC window to become the active window after the analysis is done and displayed on my LC window, so I can manipulate the various controls I have on it. Of course I can "manually" click on the LC window to activate it but I was wondering if there is a way to do so in LC script. I've tried "focus on field xxx" (where xxx is a field in my displayed LC window), "set the screenMouseLoc to the loc of this stack", "go to this stack" and a variety of "click at" commands... none of these make the LC window the top active window on the desktop. The Notepad (or whatever) window stays as the top, active window. On a somewhat related note, how do you "set" the mouse location within an LC window? I know and use the "set the screenMouseLoc to the loc of this stack" but an equivalent "set the MouseLoc to the loc of this stack" or "set the mouseLoc to "650,420"" generates an error of "Properties: token is not a property) near "mouseLoc", char 10" when trying to save the code. Seems odd that I have to use FULL screen coordinates to set the mouse location rather than relative ones to the stack. Douglas Ruisaard Trilogy Software (250) 573-3935 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode