Go Back  Mac-Forums.com  > Software > OS X - Darwin and Development > Applescript to open when closed, close when open

Reply
 
LinkBack Thread Tools
Old 05-12-2008, 04:05 AM   #1 (permalink)
Slokunshialgo

 
Member Since: Oct 19, 2006
Posts: 152
Slokunshialgo will become famous soon enough
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.
__________________
PC: Intel Core 2 Duo 2.66 GHz, 2 GM RAM, Total 750 GB HDD, Windows Vista Business (For gaming), Ubuntu 8.04 Hardy Heron (64-bit), Slackware 12 (For GTK# coding)
Mac: 1.66GHz, 1GB RAM, 60GB HDD, Mini
Slokunshialgo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript to open Front Row with currently playing iTunes song ncmason OS X - Darwin and Development 0 02-27-2007 05:36 PM
HP PhotoSmart 2575 Driver hana2004 OS X - Operating System 2 05-03-2006 07:03 PM
how to open eml file from terminal? erv2 OS X - Darwin and Development 3 02-17-2006 06:08 PM
David Hyatt on Tabbed Browsing schweb Apple Rumors and Reports 0 03-06-2003 11:24 PM
Open GUI applications as root gatorparrots OS X - Darwin and Development 1 03-03-2003 07:56 PM

 
 
 
     
Home Calendar Get New
     

Copyright ©2001-2009 Mac-Forums.com. All Rights Reserved. A division of iNET Interactive.

Other iNET Interactive Sites: Web Hosting Talk | Swish Talk | Hosting Catalog.com| Dev Papers| Deleted Domains| Hot Scripts

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