Hi,
I wrote a little handler to unlock a system preference pane. When running, the preference pane moves to the frontmost level in the Finder and disturbs the user while in another app. Is it possible to have all UI scripting executed in background ? Here is my script:
on UnlockPowerManager()
tell application "System Preferences"
launch
reveal anchor "Options" of pane id "uk.co.dssw.powermanager.preferencepane"
end tell
tell application "System Events"
tell process "System Preferences"
repeat until exists window "Power Manager"
delay 0.5
end repeat
if exists (button [i]"Pour modifier, cliquez sur le cadenas." of group 2 of window "Power Manager"[/i]) then
click button [i]"Pour modifier, cliquez sur le cadenas." of group 2 of window "Power Manager"[/i]
delay 0.5
tell application "System Events"
tell process "SecurityAgent"
set value of text field 1 of group 1 of window 1 to adminName
set value of text field 2 of group 1 of window 1 to adminPassword
delay 0.5
click button "OK" of group 2 of window "Authentification"
end tell
end tell
end if
end tell
end tell
end UnlockPowerManager
Thanks in advance.
Robert Lespérance