Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applescript activate closed window

how can I activate an application and make it open the "standard" window as if I would have clicked on the dock icon with applescript?

E.g. I am in iTunes, close the window with command-w open another application and then I click on the iTunes dock icon and iTunes becomes the frontmost application and opens up it's "standard" iTunes window.

When I want to simulate that with applescript I type:

tell application iTunes to activate

What happens then is, that iTunes becomes the frontmost application, but the "standard" window (in that case the iTunes window) isn't being opened.

Does anyone know about a way to open the "standard" window with a general approach for any application?

Thanks b00tsy

like image 954
b00tsy Avatar asked Mar 02 '26 16:03

b00tsy


1 Answers

after a long time I found out that what I expect to happen with

tell application "anyApplication" activate

actually happens with

tell application "anyApplication" reopen
like image 78
b00tsy Avatar answered Mar 06 '26 03:03

b00tsy