--Description: Login as administrator, add new user with login 1 and password 1 tell application "SANmp Admin" to activate tell application "System Events" tell process "SANmp Admin" --Login as admin set value of (first text field whose description is "Password") of (first sheet whose description is "Authentication") of window "SANmp Admin" to "adminpw111" click button "Login" of (first sheet whose description is "Authentication") of window "SANmp Admin" --Wait until all sheets close repeat until (count of sheets of window "SANmp Admin") is equal to 0 --Check if Blocking Warning if (exists (first sheet whose description is "Blocking Warning") of window "SANmp Admin") then --Proceed click button "Yes" of (first sheet whose description is "Blocking Warning") of window "SANmp Admin" end if delay 1 end repeat --Find partition repeat with nowRow in rows in (first table whose description is "Volumes List") of (first scroll area whose description is "Volumes Scroll") of (first splitter group whose description is "SANmp Admin Split View") of (first group whose description is "Main Window Group") of window "SANmp Admin" --Find partition in row if exists (first text field of nowRow whose description starts with "Disk") then select nowRow --Check if SANmp Disk if value of ((first static text whose description is "SANmp Disk") of (first group whose description is "Information Group") of (first group whose description is "Main Window Group")) of window "SANmp Admin" is equal to "Yes" then --Switch to sharing tab click (first UI element whose description is "Sharing Tab") of window "SANmp Admin" --Add new user click (first button whose description is "New User") of (first group whose description is "User Actions Group") of (first group whose description is "Actions Group") of (first splitter group whose description is "SANmp Admin Split View") of (first group whose description is "Main Window Group") of window "SANmp Admin" repeat while (not (exists (first sheet whose description is "User") of window "SANmp Admin")) delay 1 end repeat set value of (first text field whose description is "User Name") of (first sheet whose description is "User") of window "SANmp Admin" to "1" set value of (first text field whose description is "Password") of (first sheet whose description is "User") of window "SANmp Admin" to "1" set value of (first text field whose description is "Confirm") of (first sheet whose description is "User") of window "SANmp Admin" to "1" click button "OK" of (first sheet whose description is "User") of window "SANmp Admin" exit repeat end if end if end repeat end tell end tell