property
myPassword : ""
property
myServer : "SeverName"
property
myVolume : "VolumeName"
TryToMountTheServer()
on TryToMountTheServer()
try
mount volume "smb://" &
myServer & "/" &
myVolume
as user name myUsername
with password myPassword
return
on
error
set
dialogReply to
display dialog "Volume Didn't Mount, re-enter username?" &
return & return & ¬
"Username:"
default answer myUsername ¬
buttons {"Change Username", "Cancel", "No change"} ¬
default button 1 ¬
with title ¬
"Change Username"
giving up after 60
if
button returned of
dialogReply is "Change Username" then
set
myUsername to the text returned
of dialogReply
end
if
set
dialogReply to
display dialog "Volume Didn't Mount, re-enter password?" &
return & return & ¬
"Password:"
default answer myPassword ¬
hidden answer
true ¬
buttons {"Change Password", "Cancel", "No change"} ¬
default button 1 ¬
with title ¬
"Change Username"
giving up after 60
if
button returned of
dialogReply is "Change Password" then
set
myPassword to the text returned
of dialogReply
end
if
end
try
end TryToMountTheServer