• 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
Defaults Read deeper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Quark 5 can't copy selection w/styles
  • Next by Date: Re: Question about Satimage OSAX
  • Previous by thread: Re: Launching scripts from Dragthing
  • Next by thread: Forcing 'tell app' to use carbon, rather than classic app
  • Index(es):
    • Date
    • Thread