Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using an applescript to mount a users home folder. However, when I use a password with a "@" symbol the script fails since the "@" symbol is also the separator between the password and servername? Anyway around this outside of changing the password?


Here is the script:

display dialog "Please enter your username" default answer ""
set the user_name to the text returned of the result

display dialog "Please enter your password" default answer "" with hidden answer
set pass_word to the text returned of the result

set server_name to "servername"
set share_name to "sharename"
mount volume "smb://" & user_name & ":" & pass_word & "@" & server_name & "/" & share_name & "/" & user_name
share|improve this question
instead of @ use % for it – Buscar웃 Apr 21 '13 at 20:59
Note that on most Unices, you don't want to put passwords in command lines because they can then be viewed with ps and the like. – Reid Apr 23 '13 at 20:03
up vote 4 down vote accepted

Rather than using the in-line form to give the username and password, you can specify them as parameters for the mount volume command. Changing the final line to the following will work with passwords with special characters:

mount volume "smb://" & server_name & "/" & share_name & "/" & user_name as user name user_name with password pass_word
share|improve this answer
Thanks robmathers! – MooseKnuckle Apr 22 '13 at 18:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.