Read multiple values from plist with one command?

This should be obvious to me, but it isn’t, so I’m asking for help.

Is it possible to read two or more values from the same plist.info file with one command? I know I can do this:

set myPlist to "com.something.something"
set myPlistFile to ((path to preferences as Unicode text) & myPlist & ".plist")
set pListValue to do shell script "defaults read " & myPlist & space & "MyValue" 

But can I get two or more values with a single command?

Thanks for any advice or help.

Yes, the snippet is curtsey of Nigel Garvey! :slight_smile:


set f to (path to preferences from local domain as Unicode text) & "com.apple.windowserver.plist"
tell application "System Events"
	set {{|Width|:w1, |Height|:h1, |OriginX|:OX1, |OriginY|:OY1}, {|Width|:w2, |Height|:h2, |OriginX|:OX2, |OriginY|:OY2}} to value of property list items of property list item 1 of property list item "DisplaySets" of property list file f
end tell
{{w1, h1, OX1, OY1}, {w2, h2, OX2, OY2}}

Thank you!

I see from your message that what I want to do is easy:

set myPlist to "com.something.something"
set myPlistFile to ((path to preferences as Unicode text) & myPlist & ".plist")
tell application "System Events"
set keyValueOne to value of property list item "KeyOne" of property list file myPlistFile
set keyValueTwo to value of property list item "KeyTwo" of property list file my PlistFile
end tell