How can you manipulate preferences in non-scriptable applications?

Ok…I know this has been covered alot, but I cant find quit what I am looking for. I want to manipulate settings of a program I have, and I understand the click comand now. However, I do not know how to click on certain parts of windows in the preferences of the program. A similar example is itunes. I see how I can do a click command to open the preferences up. However, how do you

  1. tell a script to select (click) the tab that says “Advanced”
    2.Once this is done, how do you click on the buttons like “Change” or “Reset”
  2. And, within the “advanced” tab, how do I navigate to the “general”, “importing”, and “burning” tabs of this

If I can figure this out, I can manipulate the other pregram I am using. I dont know what they call various parts of windows (like button? checkbox?). Any help is appreciated. Ian

GUI scripting is what you need, I guess.

But as I never really did GUI scripting there might be other specialists for that!:cool:

You might be interested in Apple’s UI Element Inspector or PreFab’s UI Browser.

Try something like this:

activate application "iTunes" -- assumes iTunes v6

tell application "System Events"
	launch
	
	keystroke "," using command down -- open Preferences
	keystroke "7" using command down -- switch to Advanced panel
	
	tell process "iTunes"
		click button 3 of group 1 of tab group 1 of window 1 -- Change.
		
		-- click button 2 of group 1 of tab group 1 of window 1 -- Reset
	end tell
	
	quit
end tell

--quit application "iTunes"

Bruce, thanks for the help! It all works great. There are 2 probleme.

  1. It does click on the “change” button. But, it does not actually open it. Any reason for this?

  2. There is a value I need to change. It is changed with a slider. Do you know how to do this. Tabs and keystrokes will not work with this part.

Jacques, thanks! do you know how to move silders with this?

it is securityspy…a security camera application. The camera setup portion of it. it has a slider and tells its value in a text field. It will only save the value if the slider moves. You can type it in, but it does not save it.

Ok, I think everything is done, but I have one problem. Is there a command in OSX or suites that allows your mouse to be held down? I want to be able to drag something.

would this work for it?

repeat until (keys pressed) contains "escape"
	tell app "System Events" to click
end repeat

Ugrax, I will have to try a few things with that. You would think that extra suites would have thins command. It can tell weather the mouse is down or up, so why cant it just hold the mouse down. I was hoping there would be an if then statement I could use. Really, the program I am trying to script needs some work done to it.