micpool's picture

Hi

Most Mac Apps remember their last window position when restarting them. I can't find a way to do this with vuo compositions exported as apps. Have I missed something, or should this be a feature request?

Also, could apps created by vuo have the option to float on top?

Thanks

Comments

For saving position, there is

Bodysoulspirit's picture
Submitted by

For saving position, there is a somehow linked feature request : The composition view should have the previous size and pos after pressing Stop->Run in the Editor.
Although this is for composition running from Vuo. I guess you could make a note there you'd want that for exported apps too.

You could in the meantime set the window position yourself maybe ? Using the Change Window Position node.

I tried googling to see if that's a thing you can change in the .plist file, but some apps store it in their .db file, some on the NIB file etc. Maybe you'd have more luck than me.

Regarding float on top, there is also a feature request for that : a window property to keep it on top (of composition edit window).
Was also meant for comps running from Vuo, but since it would be a window property node, I guess that will work for exported apps too.

And until then, if for yourself (not for distribution), you could try something like this maybe ? : AfloatX

Thanks

micpool's picture
Submitted by

Thanks

I am trying to find a work around with change window position but there seems to be one major problem.

I can get the size of the window from Get Window Dimensions node, but there seems to be know way of getting the current position of a window.

From Script Editor I can get it with tell application "System Events" to get the position of window 1 of application process "Vuo Composition Loader". But if I run this in Execute Shell Command I get an Application isn't running error, Is this the sandboxing at work?

No, there is also a Feature

Bodysoulspirit's picture
Submitted by

No, there is also a Feature Request for that, and if I'm right, from the API there is not yet a way either, so you could maybe using some c code and a custom node.
Yes the Execute Shell Command node is sandboxed and pretty restricted, for security reasons.

But, why do you need to get the window position ? If you set it yourself first, then you know it later.
Joined is a composition that centers the window on the screen.

Thanks

micpool's picture
Submitted by

Thanks I am creating an app that will sit on screen, next to a piece of show control software, to receive prompts and run timers in response from OSC from the main show control app. If a user has several pieces of software in use on the desktop, they will be frequently moving the windows around. When they close the windows and resume later all the other applications will have opened their windows where they were last., but applications exported from Vuo won’t.

Thanks for the center example though, I can adapt that to always open the app in the top right corner of any display, which is a good default in the absence of the ability for it to save its last position.

Ah ok I see.

Bodysoulspirit's picture
Submitted by

Ah ok I see.
Yeah, this is the request I meant : "Get Window Position" node

I checked again in the API but see no function to make a custom node for it, so it's beyond my skills.
Otherwise with a custom node that would retrieve XY positions, until a an option to save positions would pup-up, one could have saved the moved position inside a .txt file inside the app bundle and fetch it on each app launch.

micpool,

jmcc's picture
Submitted by

micpool,

We are implementing two feature requests in the next release: an expanded Get Window Dimensions node with a Top Left position input port, for the feature Get Window Position and a window property to keep it on top (of composition edit window). We'll be implementing the latter by a Change Window Level node that changes which stacking group the window is part of.

The levels:

Background — Places the window behind normal windows, even when it has focus.
Normal— Restores the default stacking behavior, where the window is placed in front of other normal windows when it is focused, and is placed behind other normal windows when it loses focus.
Floating — Places the window in front of normal windows, even when it doesn't have focus.

We'll post a composition in the gallery when the expanded Get Window Dimensions node is released to show how you could "remember" the last position of a window and re-open it at the same window coordinates.