Re: Display Dialog
Re: Display Dialog
- Subject: Re: Display Dialog
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 21 Sep 2001 12:57:58 -0700
On 9/21/01 12:37 PM, "Mr Tea" <email@hidden> wrote:
>
set theFrontApp to name of (every process whose frontmost is true) of
>
application "Finder" -- [all one line]
Not so great, Mr. Tea, under one condition. 'every process' is a list - of
one item - so it's getting coerced OK to the string which is its single
item. But if you try this in a an applet (it's easiest if you use a
stay-open applet with an idle handler returning every 10 seconds or so),
then put the Finder itself in front, you should get an error. (Without an
idle handler, you can't do this, since double-clicking the applet will
always put the applet itself in front so you can't test for the Finder.) The
Finder doesn't consider itself to be a process, so (every process whose
frontmost is true) is {} and
name of {}
--> ERROR
(path to frontmost application as string)
won't error, and will give you the application file , which works just fine
in a 'tell application' construct.
--
Paul Berkowitz