realbasic-nug
[Top] [All Lists]

Re: Applescript Q

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Applescript Q
From: Paul Dobbs <dobbsp at charter dot net>
Date: Sat, 30 Apr 2005 14:36:24 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <d6101eaf5a57e5958ecaedf00728a09f at charter dot net> <p06020419be998d752af1 at [192 dot 0 dot 0 dot 3]>
Thanks. I think I found another way:

on run
        tell application "System Events"
                if name of processes contains "iTunes" then
                        tell application "iTunes"
                                -- do iTunes stuff
                        end tell
                end if
        end tell
end run

On Apr 30, 2005, at 2:32 PM, Dan Berghult wrote:

Is there a way in Applescript to find out if an application (such as iTunes) is running?


Here's one way to do it: (This was done in Mac OS 9 but should work in X as well)


tell application "Finder"
        copy (name of every process whose name is "iTunes") to vName
        if vName = {} then
         return "Not running"
        else
         return "Running"
        end if
end tell




Dan
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


------------------------------------------------------------
Paul Dobbs
dobbsp at charter dot net
pauldobbs at mac dot com
http://webpages.charter.net/dobbsp
------------------------------------------------------------
Intel has announced its newest chip: the Repentium!

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>