Problem Setting Values in a Property List
Problem Setting Values in a Property List
- Subject: Problem Setting Values in a Property List
- From: Rick Gordon <email@hidden>
- Date: Wed, 10 May 2006 21:06:12 -0700
[Using Tiger 10.4.6]
I was experimenting with scripting the new Property List Suite in System Events. I took on the task of ensuring that all of the Universal Access keyboard shortcuts are disabled (GUI-settable in the Keyboard & Mouse preference pane). I set up the following script, which does seem to make the same change is made by going though the preference pane interface.
--
set finalValue to 0
tell application "System Events"
set universalAccessPlist to property list file "~/Library/Preferences/com.apple.universalaccess.plist"
set userAssignableHotKeys to property list item 2 of universalAccessPlist
tell userAssignableHotKeys
repeat with i from 5 to 11
set value of property list item 2 of property list item i to finalValue
end repeat
end tell
end tell
--
If I start with all of the shortcuts enabled (i.e., under UserAssignableHotKeys, the "enabled" field of items 4 through 10 is set to 1), either going through the GUI or running the script will set them to 0. I can reopen ~/Library/Preferences/com.apple.universalaccess.plist and prove that to myself. But running the script does not cause the checkboxes in the preference pane to become unchecked.
What's the problem? Is the preference pane not realizing that the plist file has been changed, and is not updating its values? A cache issue? Or some other problem with my script.
Thanks in advance for any help.
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden