Re: Active Application
Re: Active Application
- Subject: Re: Active Application
- From: Jeffrey Mattox <email@hidden>
- Date: Thu, 27 Mar 2003 03:43:02 -0600
At 9:06 PM -0800 3/13/03, Paul Berkowitz wrote:
On 3/13/03 8:16 PM, "Philippe GRUCHET" <email@hidden> wrote:
> From: Adam Goldstein <email@hidden>
I'm trying to get the name of the application whose name appears in
>> the menu bar.
tell application "System Events" to name of first process whose
frontmost is true
I experimented with your offering. Please try this: Launch Netscape,
navigate somewhere, put the following in Script Editor, run the
script, and bring Netscape to the front before the delay expires.
delay 5
tell application "Netscape" to URL of front window -- <-- (1)
tell application "System Events" to name of first process [NO BREAK]
whose frontmost is true
tell application result to URL of front window -- <-- (2)
I see these results in the log window (OS 10.2.3):
tell application "Netscape"
get URL of window 1
--> "
http://www.apple.com/"
end tell
tell application "System Events"
get name of process 1 whose frontmost = true
--> "Netscape"
end tell
tell application "Netscape"
get URL of window 1
<<event ascrgdut>> <-- those are chevrons
get URL of window 1
--> Netscape got an error: Can't get URL of window 1.
Can you explain why the first (1) "URL of front window" works, but
the second (2) fails? In both cases, Netscape is getting the command.
Jeff
_______________________________________________
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.