Move launched app window to new location on MacOS

Q: How do I use Swift to move a new document window when it’s created?

Environment: MacOS Monterey Mini 2014

An app I use (Affinity Photo) has a bug where new documents open behind the tool panels. Every new document has to be moved (keyboard shortcut using Rectangle) to see it and begin work.

Photo is not exposed to AppleScript so I can’t automate the window move, and the bug is fixed in an update which removes what I consider vital features, so I can’t use that.

Unnecessary details:
I started using Xcode to learn Swift just for this purpose, and though I’ve gone through a half-dozen tutorials and searched a bit, I’m no closer to understanding this specific need. As a retired web developer, I have no need for a complete understanding of Swift programming, but as a full-time amateur artist, I use tools like Photo and VSCodium ((VSCodium/VSCode and other apps also have no scripting library) all day every day, and a few hours grasping this concept would still have a high ROI.

Nothing? Anyone?

I’m not sure if there is any way you can do that from an independant program you create in Xcode. Correct me if I am wrong but what you are suggesting is that the Application you create tells the new document you create in Affinity to be moved to the foreground and become the active document.

It’s also something that is outside of the scope of this community since the focus is on iOS Apps for iPhone. Have you tried any forums that are geared to Affinity?

If it’s a bug in the Affinity Photo App and the fix is an upgrade that takes away a feature you reply on then you really do have a dilemma.

Thanks for clarifying. Apologies for my confusion. Off to keep digging!