Hi everyone!
I’m currently working on a script to install a printer and enter the necessary user information into the keychain. Here is what I’ve got so far:
set keychain_entry to "HULT_Printer" --name of the Printer/ entry
set keychain_entry_user to " & userdomain & " -- Username - taken from an earlier dialog
set keychain_entry_passwort to " & printerpass & " -- User password - taken from an earlier dialog
on setPassword(new_Password)
tell application "Keychain Scripting"
unlock
try
set password of first generic key of current keychain whose name is keychain_entry to keychain_entry_passwort
on error
make new generic key with properties {name:keychain_entry, account:keychain_entry_user, password:keychain_entry_passwort, comment:"HULT Printer"}
end try
end tell
end setPassword
The script doesn’t return an error, but it doesn’t create an entry either
What have I done wrong?!
Thanks so much for your help!