Re: how to tell application using psn
Re: how to tell application using psn
- Subject: Re: how to tell application using psn
- From: Peter Baxter <email@hidden>
- Date: Wed, 10 Sep 2008 16:28:41 +1000
Hi Joe,
As this is an AS forum, I'll give you an AS result:
tell application "Firefox" to activate --not needed if you know
Firefox is already open
delay 5 -- in case Firefox takes time to open
tell application "System Events" to get title of front window of
application process "Firefox"
On 10/09/2008, at 7:39 AM, Joel Sherriff wrote:
Philip's right (except that I want to get the title of A window, not
All windows). Unfortunately I've run into two big problems - having
to rely on accessibility being enabled and/or having to rely on AS
support in the applications. Neither of which I can count on. I've
got what I want working by using some of those undocumented
CoreGraphics functions. I hate doing that, since they could go away
at any time. But it works today, and it's dirt simple. I gave up
on AS once I saw that even Firefox doesn't support something as
simple as
tell application "Firefox"
name of windows
end tell
I figure if I can't get the window titles in AS, getting them in
AppleEvents isn't going to happen either. So I gave up and used the
CoreGraphics functions.
Joel
Philip Aker wrote:
On Sep 9, 2008, at 1:37 PM, email@hidden wrote:
At 8:54 PM +0100 9/9/08, has wrote:
I've read that this is doable, but I can't find a single
example. Can
someone show me how? I just want to execute a simple script like
tell application N
name of windows
end tell
where N is the psn of the app.
PSNs not so much. You can target apps by PIDs in AS, but that
involves messing about with eppc URLs and Remote Apple Events
which introduces authentication/security issues.
I must confess that I don't remember the exact formula (I
published it once on this list, though), but it's as Has has said.
It's something like tell app "SomeApp" of machine "eppc://someURL?
pid=SomePSN" but if I remember correctly it won't work with
127.0.0.1 or localhost. eppc doesn't connect to self.
Otherwise (that is, between different machines), it works
flawlessly, except that (I think) you cannot use Keychain because
it's confused, it thinks "eppc" is really "cppe", and that hangs
the caller app.
Hey guys, I believe the OP is trying to do this:
tell application "System Events" to get title of every window of
every application process
in AppleEvents (due to a fuller explanation of his purpose on
another list).
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden
)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden