I ran the following script while both VSCode and Windsurf were open.
tell application "System Events"
set electronProcesses to every application process whose name is "Electron"
set outputText to ""
repeat with p in electronProcesses
set outputText to outputText & "Process: " & name of p
set outputText to outputText & ", Displayed name: " & displayed name of p
set outputText to outputText & ", Frontmost: " & frontmost of p & "
"
end repeat
return outputText
end tell
The script incorrectly returned two Electron processes, where both were showing Windsurf as the displayed name. The output of the above script is:
Process: Electron, Displayed name: Windsurf, Frontmost: false
Process: Electron, Displayed name: Windsurf, Frontmost: false
Separately, both Windsurf and VSCode share the same process name (Electron) but have different displayed names. This issue appears to affect how the frontmost application is detected, when using the following script:
set frontApp to first application process whose frontmost is true
The frontApp is incorrectly returned when switching between VSCode and Windsurf.
I recommend that you file a bug about this. Please post your bug number, just for the record.
In the meantime, what happens if you do this:
id of every application process whose name is "Electron"
Do you get unique IDs?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"