Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Applescript to open when closed, close when open (http://www.mac-forums.com/forums/os-x-development-darwin/108083-applescript-open-when-closed-close-when-open.html)

Slokunshialgo 05-12-2008 03:05 AM

Applescript to open when closed, close when open
 
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.


All times are GMT -4. The time now is 02:21 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.