Re: Defaults Read deeper
Re: Defaults Read deeper
- Subject: Re: Defaults Read deeper
- From: Rob Jorgensen <email@hidden>
- Date: Thu, 5 Jun 2003 07:47:19 -0400
Has this ever been answered? I need to retrieve info that is deeper
than 1 level into the plist. Is it possible without grep/parsing
routines? If so, a simple example would be GREATLY appreciated.
-- Rob
Way back on 1/7/03, Paul Skinner wrote:
Ok, trying to answer a question about getting the current audio
system volume level I used defaults read to get one layer down into
the plist data.
set fileRef to POSIX path of (((path to startup disk) as string) &
"Library:Preferences:com.apple.soundpref")
set vData to do shell script "defaults read " & fileRef & " Devices"
-->"{
InputDevices = {
\"AppleDBDMAAudioDMAEngine:0\" = {Balance = 0; DeviceLevels
= (1, 1); Level = 1; };
};
OutputDevices = {
\"AppleDBDMAAudioDMAEngine:0\" = {
Balance = 0.05593276023864746;
DeviceLevels = (0.4661593437194824, 0.4948394894599915);
Level = 0.5;
};
};
}"
--I can parse it...
set AppleScript's text item delimiters to "Level = "
set vol to word 1 of text item -1 of vData
--"0.5"
--but does anyone know the proper syntax for getting directly to any
layer below the topmost? Such as the OutputDevices?
set vData to do shell script "defaults read " & fileRef & " Devices
OutputDevices"
-->nope
set vData to do shell script "defaults read " & fileRef & "
Devices/OutputDevices"
--nada.
set vData to do shell script "defaults read " & fileRef & "
Devices;OutputDevices"
-->nutin.
--
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
--
Rob Jorgensen
Ohio, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.