Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
Hi,

Is their anyway to open up system preferences, and select a specific application within the growl preference pain, from inside a cocoa application (e.g. pressing a button) ?
 
Is their anyway to open up system preferences, and select a specific application within the growl preference pain, from inside a cocoa application (e.g. pressing a button) ?
I think AppleScript is your best bet. You can call an AppleScript from Cocoa. See the documentation for NSAppleScript and check out this page for scripting System Preferences.
 
Here you go:

Code:
tell application "System Preferences"
	activate
	set the current pane to pane id "com.growl.prefpanel"
end tell
 
Here you go:

Code:
tell application "System Preferences"
	activate
	set the current pane to pane id "com.growl.prefpanel"
end tell

Thanks again kainjow

I don't see why the following doesn't work though:

Code:
tell application "System Preferences"
	activate
	set the current pane to pane id "com.growl.prefpanel"
	get the name of every anchor of pane id "com.growl.prefpanel"
	reveal anchor "Applications" of pane id "com.growl.prefpanel"
end tell
 
Thanks again kainjow

I don't see why the following doesn't work though:

Code:
tell application "System Preferences"
	activate
	set the current pane to pane id "com.growl.prefpanel"
	get the name of every anchor of pane id "com.growl.prefpanel"
	reveal anchor "Applications" of pane id "com.growl.prefpanel"
end tell

that is because names are not assigned to the tabs in the growl panel by the developer , if you look at Result in script editor after running
Code:
get the name of every anchor of pane id "com.growl.prefpanel"
it shows a empty list {} , in com.apple.preferences.users for example you get {"passwordPref", "startupItemsPref", "mobilityPref", "loginOptionsPref", "picturePref"}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.