Metadata fields in Acrobat

I wrote the following shell script to grab proxy information for OS X:

A bit of a clumsy way of doing it, I’m sure, but I’m not too experienced with getting data from property list files.

The problem with this method is that if the user has created multiple network locations, the script is likely to grab information for the wrong one. The ID string for the current network location is stored with the “CurrentSet” property in the Preferences.plist file, but I can’t find a good way to use this information to get the correct network proxy details.

Can anyway recommend a way to accomplish this task?