UTM icon indicating copy to clipboard operation
UTM copied to clipboard

MacOS: AppleScript support for UTM to minimize UTM window

Open LostInCompilation opened this issue 2 years ago • 2 comments

It looks like UTM for macOS does not have AppleScript support. I'm opening UTM and a VM with a bash script (open://utm...) and want to minimize the VM window with bash. I thought of AppleScript (osascript) using this as a test:

tell application "UTM"
	set miniaturized of window 1 to true
end tell

This results in an error (no properties found for UTM).

Is there any other way to minimize UTM (or start minimized)? If not, could the "miniaturized" property for AppleScript be added to UTM for macOS?

LostInCompilation avatar Jun 02 '22 16:06 LostInCompilation

The UTM doesn't seem to return any of the typical properties when asked by AppleScript. For instance, the script below:

tell application "UTM"
	properties of window 1
end tell

throws the error error "UTM got an error: Can’t get every property of window 1.". I guess the properties need to be added to the compile build in order to be accessible to AppleScript?

Deadlyelder avatar Jun 03 '22 09:06 Deadlyelder

Yes it seems like no properties are available. They need to be added to the build.

I also tried using the bash "open" command with the "-j" option (launch hidden), however this completely crashes UTM. I made a new issue report for this (#4091).

LostInCompilation avatar Jun 04 '22 04:06 LostInCompilation