Some Cocoa apps ask admin codes only once when it is started first time then never ask again and still do things that requires admin rights. Is this possible with AppleScript?
You could just save your admin password as a variable in the script and insert it with GUI scripting into any Authorization windows you come across. I don’t know if it’s useful to you, but I actually made my own Authorizing script. You just run it from the Apple menu whenever your asked for your Admin password.
tell application "System Events"
repeat until exists window "Authenticate" of process "SecurityAgent"
delay 0.5
end repeat
tell window "Authenticate" of process "SecurityAgent"
tell group 1
set value of text field 2 to "Password"
end tell
delay 0.5
click the button "OK" of group 2
end tell
end tell
Edit: I fixed up the code a little. What was there was kind of lame. >.<