• 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: Windows properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windows properties


  • Subject: Re: Windows properties
  • From: Axel Luttgens <email@hidden>
  • Date: Mon, 13 Feb 2012 16:01:56 +0100

Le 13 févr. 2012 à 14:59, KOENIG Yvan a écrit :

>
> Le 13 févr. 2012 à 13:23, Axel Luttgens a écrit :
>
>> Le 13 févr. 2012 à 09:58, KOENIG Yvan a écrit :
>>
>>> [...]
>>> At this time I continue to search an explanation to the fact that I am unable to get System Events to return the Window's properties listed in its dictionary.
>>> Am’I dumb or is there something wrong in the dictionary ?
>>
>> Hello Yvan,
>>
>> To say the least, it is a bit confusing...
>>
>> There is the window object from the Standard Suite; should System Events somehow make use of windows, those windows would have the corresponding set of properties.
>>
>> Then, there's the window object defined in the Processes Suite; this is the kind of object made available when accessing processes from System Events.
>>
>> HTH,
>> Axel
>
> Hello Axel.
>
> My problem is that in the System Events dictionary we may read :
>
>
> window n [inh. item; see also Processes Suite] : A window.
> elements
> contained by application, processes, UI elements.
> properties
> bounds (rectangle) : The bounding rectangle of the window.
> closeable (boolean, r/o) : Whether the window has a close box.
> document (document, r/o) : The document whose contents are being displayed in the window.
> [...]

Yes, that's the window object as described in the Standard Suite...


> but when I ask the window's properties in a tell process block I get an other set of infos.

... while here, you are making use of a window object as described in the Processes Suite:

	window n [see also Standard Suite] : A window belonging to a process
	elements
	contains browsers, busy indicators, buttons, checkboxes, color wells, combo boxes, drawers, groups, grow areas, images,incrementors, lists, menu buttons, outlines, pop overs, pop up buttons, progress indicators, radio buttons, radio groups,relevance indicators, scroll areas, scroll bars, sheets, sliders, splitters, splitter groups, static texts, tab groups, tables, text areas, text fields, tool bars, UI elements.

Now, I don't remember if it has always been the case, but System Events' dictionary coming with Lion forgets to say that a window (from the Processes Suite) inherits from the UI element class; hence the properties you have fetched with your code:


> tell application "Preview"
> 	activate
> 	[...]
> end tell
> tell application "System Events"
> 	tell application process "Preview"
> 		[...]
> 		properties of window 1
> 		--> {minimum value:missing value, orientation:missing value, position:{1256, 144}, class:window, role description:"fenêtre standard", accessibility description:missing value, focused:false, title:"télérupteur.pdf (1 page)", size:{866, 1046}, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:"AXWindow", entire contents:{}, subrole:"AXStandardWindow", selected:missing value, name:"télérupteur.pdf (1 page)", description:"fenêtre standard"}
>
> 		[...]
> 	end tell
> end tell

HTH,
Axel


 _______________________________________________
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


References: 
 >Re: Windows properties (From: Shane Stanley <email@hidden>)
 >Rép: Windows properties (From: KOENIG Yvan <email@hidden>)
 >Re: Windows properties (From: Axel Luttgens <email@hidden>)
 >Re: Windows properties (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Windows properties
  • Next by Date: META - multipart MIME digests of this group on iPad
  • Previous by thread: Re: Windows properties
  • Next by thread: Re: Windows properties
  • Index(es):
    • Date
    • Thread