System Preferences AppleScript question

Greetings everyone. Im trying to write a script that rebuilds the classic (os 9) desktop in the osX enviornment. I can get the script to push the “Rebuild Desktop” button at (system preferences/classic/advanced/rebuild desktop). Then another menu window pops up asking me what Volume i should rebuild. How do I get the script to select the volume and push the “Rebuild” button on this new window? Heres my script;

tell application "System Preferences"
	set current pane to pane id "com.apple.preference.classic"
	tell application "System Events" to tell process "System Preferences" to tell window "Classic"
		click radio button "Advanced" of tab group 1
		delay 7
		click button "Rebuild Desktop" of tab group 1
		
	end tell
end tell

thanks

On my machine it’s text field 1 of row 1 of table 1 of scroll area 1 of group 1 of sheet 1 of window “Classic”, and the Button is button 1. I didn’t try that because I don’t want to rebuild my desktop.

Hi, skip100.

If you only have one volume, you can click the “Select All” button in group 1 of sheet 1 of the window.

tell application "System Preferences"
	activate
	reveal anchor "Advanced" of pane id "com.apple.preference.classic"
end tell

tell application "System Events" to tell process "System Preferences" to tell window "Classic"
	tell button "Rebuild Desktop" of tab group 1
		repeat until (enabled)
			delay 0.2
		end repeat
		click
	end tell
	tell sheet 1
		repeat until (it exists)
			delay 0.2
		end repeat
		click button "Select All" of group 1
		tell button "Rebuild"
			repeat until (enabled)
				delay 0.2
			end repeat
			click
		end tell
	end tell
end tell

I’m not sure how you’d go about selecting a particular volume. Nothing I’ve tried so far enables the “Rebuild” button. :expressionless: