Re: Using Property List Tools and Variables
Re: Using Property List Tools and Variables
- Subject: Re: Using Property List Tools and Variables
- From: SK <email@hidden>
- Date: Tue, 20 Jul 2004 17:56:03 -0700
I am running Panther and a copy of the .plist is at the bottom of this
message. If I run:
set vSystemValue to |System Sleep Timer| of |AC Power| of vPlist
instead of
set vSystemValue to |System Sleep Timer| of |vEnergyProfile| of vPlist
or
set vSystemValue to |System Sleep Timer| of vEnergyProfile of vPlist
it works fine. But I get the name of the Energy Profile from a popup
list I have constructed, so the user can pick the profile they are
using and I need to use a variable.
The error produced looks like this:
Can't get |vEnergyProfile| of {|AC Power|:{|Wake On LAN|:1.0, |Dynamic
Power Step|:0, |Display Sleep Timer|:126.0, |Reduce Processor Speed|:0,
|Automatic Restart On Power Loss|:0, |Disk Sleep Timer|:10.0, |System
Sleep Timer|:180.0, |Wake On AC Change|:0, |Wake On Clamshell
Open|:1.0, |Wake On Modem Ring|:1.0}, |Battery Power|:{|Dynamic Power
Step|:1.0, |Display Sleep Timer|:20.0, |Reduce Processor Speed|:0,
|Automatic Restart On Power Loss|:0, |Disk Sleep Timer|:5.0, |System
Sleep Timer|:20.0, |Wake On AC Change|:0, |Wake On Clamshell Open|:1.0,
|Wake On Modem Ring|:0}}.
Thanks,
Sean
---------------------------PLIST BELOW-------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AC Power</key>
<dict>
<key>Automatic Restart On Power Loss</key>
<integer>0</integer>
<key>Disk Sleep Timer</key>
<integer>10</integer>
<key>Display Sleep Timer</key>
<integer>126</integer>
<key>Dynamic Power Step</key>
<integer>0</integer>
<key>Reduce Processor Speed</key>
<integer>0</integer>
<key>System Sleep Timer</key>
<integer>180</integer>
<key>Wake On AC Change</key>
<integer>0</integer>
<key>Wake On Clamshell Open</key>
<integer>1</integer>
<key>Wake On LAN</key>
<integer>1</integer>
<key>Wake On Modem Ring</key>
<integer>1</integer>
</dict>
<key>Battery Power</key>
<dict>
<key>Automatic Restart On Power Loss</key>
<integer>0</integer>
<key>Disk Sleep Timer</key>
<integer>5</integer>
<key>Display Sleep Timer</key>
<integer>20</integer>
<key>Dynamic Power Step</key>
<integer>1</integer>
<key>Reduce Processor Speed</key>
<integer>0</integer>
<key>System Sleep Timer</key>
<integer>20</integer>
<key>Wake On AC Change</key>
<integer>0</integer>
<key>Wake On Clamshell Open</key>
<integer>1</integer>
<key>Wake On Modem Ring</key>
<integer>0</integer>
</dict>
</dict>
</plist>
------------------------------------------------------------------------
-----------------------
spk email@hidden
------------------------------------------------------------------------
-----------------------
"When we destroy something man has created we call it vandalism......
When we destroy something that Gaia has created we call it progress."
On Jul 20, 2004, at 16:07, Walter Ian Kaye wrote:
At 03:15p -0700 07/20/2004, SK didst inscribe upon an electronic
papyrus:
I am using the List & Record Tools and Property Tools from Late Night
software to read the PowerManagement plist file and get the value of
"System Sleep Timer" for the "AC Power" profile. I have it almost
working but it seems that I am unable to use the vEnergyProfile
variable in the last line of code in this example. If I replace the
variable name with the actual string, everything works fine. Does
anyone have any suggestions on what I am doing wrong, or how I can
work
around this?
set vEnergyProfile to "AC Power"
set vPlistFile to (path to startup disk as string) &
"Library:Preferences:SystemConfiguration:
com.apple.PowerManagement.plist"
set vPlist to read property list file (vPlistFile)
set vSystemValue to |System Sleep Timer| of |vEnergyProfile| of vPlist
Please tell us what values you get. I don't even have any System Sleep
Timer or "AC Profile" in my PowerManagement plist, so I am unable to
test this.
(My PM plist is also loose in the prefs folder, not in a subfolder;
I'm on Jaguar.)
-boo
_______________________________________________
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.