A couple of months ago, we had this conversation:
On Sep 19, 2011, at 5:06 PM, Stan Cleveland wrote: On Sep 15, 2011, at 1:27 PM, Luther Fuller wrote: On Sep 15, 2011, at 11:12 AM, Luther Fuller wrote: Somewhere, I have a script that uses the -plist option to create a record via System Events. Reading the record is obviously easy. Would the -xml option for 'system_profiler' work the same way? I don't know. When I find my script, I will let you know.
I found the script and annotated it ...
Try it with the 'system_profiler' command with the -xml option. It may not work. I don't know.
Hi Luther,
Nice. It does work with 'system_profiler' data! So that's a fast and easy option for Jeffrey to parse the system hardware data.
I have verified that this script works ...
quoted form of (POSIX path of testImage) do shell script "hdiutil imageinfo -plist " & the result set response to the result -- text in xml format tell application "System Events" set infoRecord to value of (make property list item with properties {text:response}) end tell
I needed to get infoRecord for a command that had the -xml option, but not the -plist option, so I tried ...
do shell script "drutil info -xml" set response to the result -- text in xml format tell application "System Events" set infoRecord to value of (make property list item with properties {text:response}) end tell
but, I get an error in the last line.
If I log the raw text, I can see the difference in the response, but I can't see how to make a record form the xml text. 'system_profiler' must be an exception. Or there's something more I need to understand.
Anyone see what my problem is?
|