• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Window title of frontmost application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window title of frontmost application


  • Subject: Re: Window title of frontmost application
  • From: Craig Sutherland <email@hidden>
  • Date: Fri, 25 Apr 2003 20:33:56 -0500

Adam,

I believe that the window reference number is assigned in the order the
windows were opened. The list is FIFO.

In System Events each object has attributes. In this case window has
the "focused" attribute which is a bool ean.

##########################
tell application "System Events"
get every process
set jdProcess to (the name of application processes whose frontmost is
true) as text
tell process fm
set jdWindow to every window whose focused is true
end tell
end tell
#########################

HTH

Craig

> This will get it with out reference errors.
> --
> tell application "System Events"
> set fm to (the name of application processes whose frontmost is
> true) as
> text
> tell application process fm to return the name of window 1
> end tell
>
>snip<>

>> I want to do something like this:
>>
>> tell application "System Events"
>> return name of item 1 of (application processes whose frontmost is
>> true)
>> end tell
>>
>> But instead of simply returning there, I want to get the title of the
>> frontmost window. Connecting the application process to the window
>> information is what is eluding me. I can't seem to "tell" an
>> application name that is stored in a variable.
>>
>> On Friday, Apr 25, 2003, at 18:31 US/Central, John Delacour wrote:
>>> you are talking of Mail.app the windows are back to front, so if
>>> you want the name of the front window, ask for the name of the back
>>> window !
_______________________________________________
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.

References: 
 >Re: Window title of frontmost application (From: Adam Hinshaw <email@hidden>)

  • Prev by Date: Re: TIDs and other questions
  • Next by Date: Re: Path to ... as string [was Re: Complete newbie]
  • Previous by thread: Re: Window title of frontmost application
  • Next by thread: Re: Window title of frontmost application
  • Index(es):
    • Date
    • Thread