Defaults Read deeper
Defaults Read deeper
- Subject: Defaults Read deeper
- From: Paul Skinner <email@hidden>
- Date: Tue, 7 Jan 2003 10:49:57 -0500
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.