Elements in Named Lists

Hi folks. I’m trying to reduce the feedback from this instruction:

tell application "Google Chrome" to get properties of window 1

It returns a list of many properties, all named:

{closeable:true, zoomed:false, active tab index:41, class:window, index:1, visible:true, name:"MacScripter / Post new topic", miniaturizable:true, mode:"normal", active tab:tab id 245 of window id 86 of application "Google Chrome", id:86, miniaturized:false, resizable:true, bounds:{2112, 25, 3565, 2064}, zoomable:true}

I am assuming this is a list, and that I can ask for the bounds of this list. But I don’t know how. How can I ask for the bounds? How can I ask for mode?ii don’t think I have to iterate the list to qualify an item. I can’t find any notes on named lists online.

Any insight appreciated. Cheers

this shud get u the bounds


tell application "Google Chrome" to get bounds of window 1

similarly mode


tell application "Google Chrome" to get mode of window 1

That might be because they are records, not ‘named lists’.

Excellent. Thank you.

An array is not defined by “a collection of element”. An empty array is still an array. If that is the proper term for this, then it’s misleading.

https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_lexical_conventions.html#//apple_ref/doc/uid/TP40000983-CH214-SW10 From the Applescript Language Guide Lexical Conventions…

In Literals and Constants, it defines list and record. The List entry provides a link to the list class where it describes it as:

https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCDBHIE

For some reason, the record entry does not provide a link to the record class, where further details are offered including a description:

https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCDGEAH

Hope this helps.

Yes, but they are two separate objects. That’s what I was making clear.

And there is nothing strange about that. You yourself get the values of the keys (properties) separately. But no one is forcing you to do this. Get them in a single list:


tell application "Google Chrome" to {mode, bounds} of window 1