- Joined
- Oct 24, 2016
- Messages
- 2
- Reaction score
- 0
I'm extremely new to AppleScript as in I only started playing with it last week. I wrote a script to mount a share and set up a time machine destination based on the user's name. This works fine unless the user's password has an @ sign in it. I was hoping that I could use tmutil setdestination -p so that it would prompt for the password but it won't do that if it's executed via applescript. So I was wondering how I can get the password into tmutil either by passing the password or getting the prompt visible from tmutil.
Below is a sample of my script:
This mounts the volume:
mount volume mvolafp as user name uname with password pword
This configures time machine only if the user's password does not contain an @ sign:
do shell script "tmutil setdestination \"afp://" & uname & ":" & pword & "@" & mvol & "\"" with administrator privileges
I'm even starting to think of crazy ideas like having applescript create a shell script with the tmutil command and then have it execute that script.
Any ideas? It may seem easier to teach the users how to set up time machine but that would be the very last resort. Thank you.
Below is a sample of my script:
This mounts the volume:
mount volume mvolafp as user name uname with password pword
This configures time machine only if the user's password does not contain an @ sign:
do shell script "tmutil setdestination \"afp://" & uname & ":" & pword & "@" & mvol & "\"" with administrator privileges
I'm even starting to think of crazy ideas like having applescript create a shell script with the tmutil command and then have it execute that script.
Any ideas? It may seem easier to teach the users how to set up time machine but that would be the very last resort. Thank you.