• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Defaults Read deeper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defaults Read deeper


  • Subject: Re: Defaults Read deeper
  • From: Paul Skinner <email@hidden>
  • Date: Thu, 5 Jun 2003 09:21:42 -0400

Defaults just can't do it.
Parse it or use an xml translation tool.

Paul Skinner

On Thursday, June 5, 2003, at 07:47 AM, Rob Jorgensen wrote:

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.
_______________________________________________
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.

References: 
 >Re: Defaults Read deeper (From: Rob Jorgensen <email@hidden>)

  • Prev by Date: Acrobat 6.0 window bounds
  • Next by Date: Re: Default Path on OSX
  • Previous by thread: Re: Defaults Read deeper
  • Next by thread: Acrobat 6.0 window bounds
  • Index(es):
    • Date
    • Thread