Applescript to open when closed, close when open

Joined
Oct 19, 2006
Messages
152
Reaction score
7
Points
18
I recently installed Mira, which lets me run commands/apps/applescripts by a press of a button on the remote. What I want to do here is set up a simple applescript to check if an app is open, and if it is, close it, but if it's closed, open.

So, basically, the sort of syntax in a C-style language:

Code:
if (app.opened() == false)
  app.open();
else
  app.close();

Can anybody shed some light on how to do this? I've been googling it for a bit, cand cannot come across much to see if an app is open or not.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top