Settings spaces keyboard modifiers

Hi List,

I Can’t help feeling like i’m doing something silly here but this just doesn’t seem to work…

here is an example script from macosxautomation.com


-- GET AND SET PROPERTIES
tell application "System Events"
	tell expose preferences
		tell spaces preferences
			set spaces enabled to true
			
			get properties
			-- {spaces enabled:true, spaces rows:1, arrow key modifiers:«class
			
			-- SET THE PROPERTIES AND APPLICATION ASSIGNMENTS
			set properties to {spaces rows:1, spaces columns:3}
			set application bindings to {|com.apple.Mail|:1, |com.apple.AddressBook|:1, |com.apple.Safari|:2, |com.apple.Xcode|:3}
			
			-- SET MODIFIERS OF SWITCHING KEYS
			properties of arrow key modifiers
			-- {class:spaces shortcut, key modifiers:{control}}
			set key modifiers of arrow key modifiers to {command}
			properties of numbers key modifiers
			-- {class:spaces shortcut, key modifiers:{control}}
			set key modifiers of numbers key modifiers to {command}
		end tell
	end tell
end tell

Everything works except the 2 “set key modifers…” lines

I’ve seen numerous other examples of this method for setting spaces key modifiers but none of them work for me.

If anyone can set me straight i’d be much obliged, It’s driving me nuts.

Cheers
Louis

I’m having the same experience, with the sample from http://www.macosxautomation.com/applescript/features/system-prefs.html and several variations thereof. Strategically placed ‘get properties’ statements show the values for arrow key modifiers and numbers key modifiers get assigned but don’t stick. (???) I’'m still trying to get to the bottom of this. Meanwhile, I ran across a Google-cached web page which indicates that some objects are read-only, including Spaces arrow key modifiers and numbers key modifiers. The original web page, supposedly at http://la-onger.long-er.name/files/Books/programming/python/appscript/applescript/frame-html/System%20Events-AS/html/FULL/classes/spaces_preferences_object.html, seems to be unavailable or inaccessible, but here’s what it said:

Class spaces preferences object
reduce
Description

user’s spaces application bindings and navigation preferences

* Defined in:
      o Expose Preferences Suite
* Inherits from:
      o item (Disk-Folder-File Suite) → item (Standard Suite)

Properties

* class (r/o) type class -- The class of the object.
* properties record -- All of the object's properties.
* id (r/o) Unicode text -- the unique ID of the item
* name Unicode text -- the name of the item
* application bindings record -- binding of applications to specific spaces
* arrow key modifiers (r/o) spaces shortcut -- keyboard modifiers used controlling the arrow key navigation through spaces
* numbers key modifiers (r/o) spaces shortcut -- keyboard modifiers used controlling the number key navigation through spaces
* spaces columns integer -- number of columns of spaces
* spaces enabled boolean -- is spaces enabled?
* spaces rows integer -- number of rows of spaces

Notes

* Contained by:
      o expose preferences object (Expose Preferences Suite)