How to convert System_profiler XML to array in applescript

I’ve tried searching, but it says I don’t have permission to use this feature.

I’m trying to take the System_Profiler xml output and put that in an array in AppleScript for later dumping into a MySQL database.

Does anyone have ideally a script to do this, or examples that will help me interpret the XML to the array?

I’m fine on adding the data to MySQL using a the do shell script command, just need to know how to get the data from the file, ready to import.

Thanks

Have you looked at the man page for system_profiler? As an example, here’s your fonts:


set tFonts to paragraphs of (do shell script "system_profiler SPFontsDataType | grep 'Full Name' | cut -d ':' -f 2 | cut -c 2-50")