Thanks guys, and as Thomas mentioned i do ave a request not to insert the password every time, one time on app start, the pass stays in a protected memory bloc and once app closes the data gets cleared.
the problem is that it will be used for multiple macs so that the username and pass must be as variables, i did something like the apple script example in the docs but unfortunately it is not working or most probably i`m doing something wrong.
the purpose would be to test if the pass is the right one or not and to have it there temporary, so far for password validity i wanted to have something like a apple script and to be called like :
dim response as string
response = CheckPassValidity(username, password)
and the apple script should be like this :
on run {value1, value2}
do shell script "sudo -s" user name value1 password value2 with administrator privileges
set answer to text returned of result
return answer
end run
so eventually if the pass and the user are ok then the response is “” otherwise the response will be “error “The administrator user name or password was incorrect.” number -60007”
and i could have either a boolean response or a string response , so far i wanted to be string but no luck .
Once that validated it will save the pass and go on with the rest of the procedures.
mostly will be for managing mysql server , uninstalling, installing , start , stop , status and so on.
so any other idea is more than welcomed , the username will be retrieved automatically as well from shell but the pass has to be inputed by user and validated.