New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Applescript to open when closed, close when open


Post Reply New Thread Subscribe

 
Thread Tools
Slokunshialgo

 
Member Since: Oct 19, 2006
Posts: 152
Slokunshialgo will become famous soon enough

Slokunshialgo is offline
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
QUOTE Thanks

Post Reply New Thread Subscribe


« Can't run Perl scripts in Leopard | Carbon fwk - Filtering Files in open dialog »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump

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

All times are GMT -4. The time now is 03:15 AM.

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

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?