Hi,
I'm a beginner at applescripting and I'm trying to get a script to run at my work to map network drives to the mac. Each user has their own individual login. I'm currently getting syntax errors all over the place.
thanks for the help in advance.
I'm a beginner at applescripting and I'm trying to get a script to run at my work to map network drives to the mac. Each user has their own individual login. I'm currently getting syntax errors all over the place.
thanks for the help in advance.
Code:
-- Collect Username
set prompt to "Please enter your username:"
set dialogResult to display dialog prompt buttons {"Cancel", "OK"} default button 2 default answer "" with icon 1
set theUsername to text returned of dialogResult
-- Collect Password
set prompt to "Please enter password:"
set dialogResult to display dialog prompt buttons {"Cancel", "OK"} default button 2 default answer "" with icon 1 with hidden answer
set thePassword to text returned of dialogResult
-- Define shares
set mapdrive1 to "smb://example\" & theUsername & ":" & thePassword & "@server.example.com/share""
-- Mount Volumes
mount volume mapdrive1
Attachments
Last edited by a moderator: