Hi, I'm new, with a possibly simple question....

I’m trying to write a simple script that will access the system preferences pane and then access “desktop & screen saver”.

I’ve tried many ways, but I can’t seem to access anything that has an “&” in its title. Any answers or suggestions?

Here’s the basic script I’m trying to use.

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.xxxx"
end tell

If I set “xxxx” to any of the other preferences such as “displays” or “energysaver” it works fine. I just don’t know what format that would go in.

Please help!

You’re using the wrong id. Try this:

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.desktopscreeneffect"
end tell

To see a list of ids, use this:

tell application "System Preferences"
	activate
	return id of every pane
end tell

Wow, thanks :smiley: I was searching for something that would do that. :smiley:

When I do this in OS X 10.3.9, I get:

with id highlighted. I don’t see id as the property of a pane; is that a Tiger-only property?

What can be done is


tell application "System Preferences"
	activate
	name of every pane
end tell

I don’t know. Does this work?

tell application "System Preferences"
	activate
	return every pane
end tell

We cross posted - I edited mine to get the name. Thanks

Using ‘name’ might cause problems for users of other languages.

True. However, the names are the names. There is also “localized name” which is in the language chosen. To find out what the file name for a given panel is, use this after opening the pane you want:

tell application "System Preferences"
	activate
	name of current pane
end tell