How to set window properties of a Launched text file

Mac environment …
While my application is processing data - it is writing errors to a text file.
At the end of the process, if there are errors, I “launch” the text file so it opens and displays the text file

Is there a way to adjust the size / location of the windows showing the text file?
I checked WindowCount before and after the launch … and it doesn’t change …
(so - it appears I cannot use Window(n) properties)

You’re launching an external application to your Xojo app so WindowCount will do nothing. WindowCount only reflects YOUR app windows.

I’m not an Applescript person, but there’s probably a way to call TextEdit, open the file, and resize the window.

Or, alternatively, you could create a simple viewer in your application using a TextEdit control. Pass the file in via FolderItem, then use TextInputStream to read the file and display it in the control. That way you have TOTAL control over it.

If you’re using FolderItem.Launch then the text file is opened in a different app, which from Xojo you do not have control over. You might be able to use AppleScript or something, but controlling another app will require that the user allow your app access to Assistive Devices in System Preferences.

If you were to display the error log in your own app, you’d have complete control over the window.

Edit: lol Bob beat me to it.

I’m using a listbox and a TextArea for this:

The listbox is pointed to the location of my session log files. When a row is clicked the file is loaded.

Tim Parnell wrote :[quote]You might be able to use AppleScript or something, but controlling another app will require that the user allow your app access to Assistive Devices in System Preferences.[/quote]

This is not true.

The listbox / TextArea will fit perfect for what I am doing … thank you!
(And thanks for clarifying the Window usage …)

Oh when did that change? Do you know an app that controls other apps without asking?
That needs to be reported right away.

The way it’s supposed to work, is that if it doesn’t show up in the list (screen below,) it can’t control your computer.

sigh I’m losing faith in OS X more and more every day.

AppleScript does not need anything added there to launch TextEdit.

Also, it does seem possible to script window size and position
https://www.snip2code.com/Snippet/27934/AppleScript-to-set-the-position-and-size

This kind thing will require a temporary entitlement in the MAS, and am not sure the reviewer will accept that, though.