Re: Forcing a unique reference
Re: Forcing a unique reference
- Subject: Re: Forcing a unique reference
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 28 Jul 2006 11:45:16 -0400
Yeah you're basically right, but the hiccup I'm running into is that System Events seems to favor "named references" ... almost pathologically so. So when I've got 4 processes all named "DashboardClient," I have to be careful in formulating my references to them that I don't end up with a reference by name, because *although it provided the reference*, it's not capable of uniquely resolving it.
The workaround I've come up with is to use a reference to a whose specifier:
tell application "System Events" set myWidgets to (application processes whose title is "Weather") end tell
This returns a reference of the form:
every application process of application "System Events" whose title = "Weather"
Whose items I can safely manipulate via "item 1 of myWidgets" etc. Without the "a reference to" clause I get:
{application process "DashboardClient" of application "System Events", application process "DashboardClient" of application "System Events"}
Which is a list of exactly the kind of references that System Events is incapable of distinguishing between.
Daniel
On Jul 28, 2006, at 11:18 AM, Andrei Tchijov wrote: I am not an expert in AppleScript, but ... once you have list of processes, can't you iterate through this list, find the one you are looking for and than use this object (process) in to do what ever you do to make widget to show up?
Sorry, if I am completely off the mark.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden