Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

launch-window smoke: address the test build by pid, the user's own Highball may be running

Gauthier Piarrettec56e3851cdbd
diff --git a/Scripts/launch-window-smoke.sh b/Scripts/launch-window-smoke.sh
index f871a1e..9c4336b 100755
--- a/Scripts/launch-window-smoke.sh
+++ b/Scripts/launch-window-smoke.sh
@@ -14,17 +14,20 @@ APP="${1:-$ROOT/dist/Highball.app}"; BIN="$APP/Contents/MacOS/Highball"
[ -x "$BIN" ] || { echo "no app at $APP (run Scripts/make-app.sh)"; exit 2; }
OUT="$ROOT/private/launch-window-smoke"; mkdir -p "$OUT"
H="${TMPDIR:-/tmp}/hb-launch-window-smoke"; rm -rf "$H"; mkdir -p "$H"
-wins(){ osascript -e 'tell application "System Events" to tell process "Highball" to get name of every window' 2>/dev/null | tr -d '\n'; }
+# Address the test build by pid, never by name: the user's own Highball may be running too, and
+# a name lookup then talks to the wrong app (2026-09-08: every step came back empty that way).
+pid(){ pgrep -n -f "$BIN"; }
+wins(){ osascript -e "tell application \"System Events\" to tell (first process whose unix id is $(pid)) to get name of every window" 2>/dev/null | tr -d '\n'; }
record(){ python3 -c "import json,time;json.dump({'passed':'$1'=='true','epoch':int(time.time()),'date':time.strftime('%Y-%m-%d'),'windows':'$2'},open('$OUT/latest.json','w'),indent=2)"; }
pkill -f "$BIN" 2>/dev/null; sleep 1
HIGHBALL_HOME="$H" "$BIN" >/dev/null 2>&1 & sleep 6
-osascript -e 'tell application "Highball" to activate' >/dev/null 2>&1; sleep 1
+osascript -e "tell application \"System Events\" to set frontmost of (first process whose unix id is $(pid)) to true" >/dev/null 2>&1; sleep 1
echo "after launch: $(wins)"
-osascript -e 'tell application "System Events" to tell process "Highball" to keystroke "," using command down' >/dev/null 2>&1; sleep 2
+osascript -e "tell application \"System Events\" to tell (first process whose unix id is $(pid)) to keystroke \",\" using command down" >/dev/null 2>&1; sleep 2
echo "after Cmd-,: $(wins)"
-osascript -e 'tell application "System Events" to tell process "Highball" to click button 1 of window "Highball"' >/dev/null 2>&1; sleep 1
+osascript -e "tell application \"System Events\" to tell (first process whose unix id is $(pid)) to click button 1 of window \"Highball\"" >/dev/null 2>&1; sleep 1
echo "after closing main: $(wins)"
-osascript -e 'tell application "System Events" to tell process "Highball" to keystroke "q" using command down' >/dev/null 2>&1; sleep 3
+osascript -e "tell application \"System Events\" to tell (first process whose unix id is $(pid)) to keystroke \"q\" using command down" >/dev/null 2>&1; sleep 3
pgrep -f "$BIN" >/dev/null && pkill -9 -f "$BIN"; sleep 1
HIGHBALL_HOME="$H" "$BIN" >/dev/null 2>&1 & sleep 7
w=$(wins); echo "after relaunch: $w"