February 17, 20205 yr I'm pretty sure the answer is no, but is there a way to capture the position of a window so that I can do a script that will snap it back to its original position when a user moves it? As far as I know, there are no script triggers that can run when a window is moved, just changed (dimension, mode, etc.)
February 18, 20205 yr This is the first I’ve heard such a request. What’s the use case? Why do you care that the user moved the window?
February 18, 20205 yr Author Good question... I have a window acting as a kind of launcher with buttons. It's only 100 pixels wide. Some of the buttons have popup windows that in turn open a card window that is much larger. Since a new card window is based on the parent, I've done some convoluted math to make sure it appears on the screen near the main window. The problem is, if the user moves the main window, the card may end up off the screen with no way to interact with it. That's why I want to move the main window back to its original location if they move it. I have set a script step that moves the main window when the card window is opened, but that doesn't prevent them from moving it after the card appears.
February 19, 20205 yr 21 hours ago, vinnygi said: I've done some convoluted math to make sure it appears on the screen near the main window. The problem is, if the user moves the main window, the card may end up off the screen with no way to interact with it. Can't you use some more "convoluted math" to prevent this from happening?
February 19, 20205 yr Spawn a regular window off-screen. Pop the card window from that. Then the user can't move. It will need to be based on it's own file, or the user won't be able to do anything else with any window. Generally, I'm not a fan of forcing things on the user, unless absolutely necessary. So you will need to consider if that's really necessary vs just having a floating window they can place where they want. You may also need to do some dancing to make sure scripts don't inadvertently take over that launcher window. A separate file can go a long way in making that management easier.
Create an account or sign in to comment