tell application "Xcode"
activate
end tell
tell application "System Events"
tell process "Xcode"
tell menu bar 1
tell menu bar item "Xcode"
tell menu 1
click menu item "Preferences…"
end tell
end tell
end tell
delay 2
click button 12 of radio group 1 of scroll area 1 of window "Xcode Preferences" --SCM
delay 2
set repositories to table 1 of scroll area 1 of tab group 1 of group 1 of group 1 of window "Xcode Preferences"
set my_rows to get every row of repositories
set row_repository to {}
repeat with r in my_rows
set tf to text field 1 of r
if value of tf is "MyRepository" then
set row_repository to r
exit repeat
end if
end repeat
if row_repository is {} then
set add_button to (button 1 of tab group 1 of group 1 of group 1 of window "Xcode Preferences")
tell add_button
click
end tell
delay 2
set value of text field 1 of sheet 1 of window "Xcode Preferences" to "MyRepository"
delay 2
click button "OK" of sheet 1 of window "Xcode Preferences"
delay 2
--path field
set path_field to text field 6 of group 1 of tab group 1 of group 1 of group 1 of window "Xcode Preferences"
tell path_field
delay 2
select
set value to "//src/CVS/devel"
delay 2
end tell
delay 2
delay 2
click button "Apply" of list 1 of window "Xcode Preferences"
end if
end tell
end tell
Everything almost works, I can see value //src/CVS/devel in the Path field
but clicking on the button Apply has no effect and if I quit and restart Xcode Path field is empty
it looks like setting value isn't really working: Xcode didn't get that value - it's only visual
I tried to use select, but it didn't help
is it known problem?
if I manually type "//src/CVS/devel" in the Path text field and click on the "Apply" button everything does work
it is similar to the setting values for the field in the Xcode target properties dialogs
thanks