Hi! I’m working on a script that opens a window, and I’m tired of closing the previous window by hand on each change and re-run. I figured I can do this to close the previous window, but not sure if it properly terminates it? Feels hacky, so I wonder if there’s a proper way to do so?
for window in NSApp.windows():
if window.title() == 'My Window Name':
window.close()