[ad_1]
I am writing a little bit script to run when a Home windows/Wine-turned-macOS(using-Automator) app is opened.
To maintain it gentle, the app doesn’t bundle Wine, as a substitute the script checks if it is (Wine) put in by Homebrew, or if it is in /Functions, it checks if some anticipated mounts for the present consumer can be found and if the Home windows app is already working (utilizing pgrep -f), solely then it will proceed and really name Wine –wherever it discovered it– to run the Home windows executable.
I believe I’ve coated all bases apart from what occurs if the app is already working; whether it is I might like to only pull it into focus as a substitute of trying to relaunch it (regardless if it will run a couple of occasion). Once more, utilizing pgrep -f is fairly simple to search out the method ID of the app with no errors, so I might like to try utilizing that to convey the app into focus if doable as I do not know AppleScript* and, I used to be simply now studying AppleScript makes use of “window IDs” for interplay anyway, not course of IDs, and it seems just like the app should be (Apple)scriptable to have this ID, which I do not assume a Wine app even remotely is.
*: satirically although, for testing, as a substitute of one thing like
echoI am utilizingosascriptto indicate notifications. However that is as advanced I can do, AppleScript’s verbosity is tremendous complicated to me. :/
I am working macOS 10.14 spctl --master-disabled; however I am pleased to revert all to 10.13 if the answer requires it. I am open to solutions, even when it is AppleScript.
[ad_2]
