Re: Name of Active Process
Re: Name of Active Process
- Subject: Re: Name of Active Process
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 17 Jun 2004 06:36:00 -0700
Well, he did say 'as text' which should have coerced the single-item list to
the same text without the list braces. (I do wish people would start getting
used to 'as Unicode text' though: one of these days, 'as string', 'as text'
is going to land you in trouble.)
Why bother with coercions, though? 'first' is designed for this situation
(OK, 'some will work too, but...) And why use the Finder (yet another
coercion) when it's System Events that actually does this job and you're
(David) is calling System Events two lines later anyway?
tell application "System Events" to set frontProcess to name of first
process whose frontmost is true
--
Paul Berkowitz
>
From: "Marc K. Myers" <email@hidden>
>
Date: Thu, 17 Jun 2004 02:29:05 -0400
>
To: <email@hidden>
>
Subject: Re: Name of Active Process
>
>
I find that doesn't work OMM (OS X 10.2.8). "name of EVERY process
>
whose frontmost is true" returns a one-item list which the "tell
>
application" statement doesn't like. Changing it to "name of SOME
>
process whose frontmost is true" fixes it as it returns a string.
>
>
Marc [06/17/04 2:26:52 AM]
>
>
> From: David Andrews <email@hidden>
>
> Subject: Re: Name of Active Process
>
> Date: Wed, 16 Jun 2004 22:06:10 -0400
>
> To: AppleScript-Users Users <email@hidden>
>
>
>
> Thanks for the suggestions. Unless you see something that is in poor
>
> taste, I think I'll go with:
>
>
>
> tell application "Finder" to set frontProcess to (name of every
>
> process whose frontmost is true) as text
>
> tell application "RealOne Player" to activate
>
> tell application "System Events"
>
> tell process "RealOne Player"
>
> click menu item "Zoom Window" of menu "Window" of menu bar item
>
> "Window" of menu bar 1
>
> end tell
>
> end tell
>
> tell application frontProcess to activate -- return to the process
>
> that was interrupted
>
>
>
> The above seem so work from the Script Editor, from the script menu
>
> and as an App.
>
>
>
> On Jun 16, 2004, at 12:11 AM, Joseph Weaks wrote:
>
>
>
>> I recommend:
>
>>
>
>> tell application "Finder" to set frontProcess to ((displayed name of
>
>> (path to frontmost application)) & return)
>
>>
>
>> Because these two fail in some circumstances, such as when launched
>
>> from the Script Menu:
>
>> --tell application "Finder" to set frontProcess to (frontProcess &
>
>> (name of every process whose frontmost is true) & return)
>
>> --tell application "System Events" to set frontProcess to
>
>> (frontProcess & (name of every process whose frontmost is true))
>
>>
>
>> Joe Weaks
>
>>
>
>> On Jun 15, 2004, at 10:32 PM, David Andrews wrote:
>
>> [snip]
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.