|
|
#1 |
|
Prospect
Join Date: Jun 2007
Posts: 5
|
Hey,
I'm trying to write an AppleScript to mount a student's network file space. At present it mounts a share Users. They then have to open Students and find their username in a list of roughly 5000 names. I want it to go straight to their folder. The AppleScript I have prompts for their username and password, but I can't get it to mount anything deeper than Users. I tried having the script look for a folder named Students but it can't even see that the folder exists. How would I get my AppleScript to mount this network share? |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jan 2002
Posts: 10,677
|
Is this an SMB share or AFP share?
|
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jun 2007
Posts: 5
|
It's an AFP share. I looked all over but can't find anything about mapping more than one share deep.
|
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
well
Code:
tell application "finder"
mount afp://ip.of.share
end tell
|
|
|
|
|
|
#5 |
|
Prospect
Join Date: Jun 2007
Posts: 5
|
Users authenticate through Active Directory. My script presently tells it to
Mount "afp://" & user_name & ":" & pass_word & "@files.geneseo.edu/Users/" Where user_name and pass_word are input by the user. However, if I run a check to see if the Students folder exists in there, it says it isn't, when it clearly is. If I try to mount "afp://" & user_name & ":" & pass_word & "@files.geneseo.edu/Users/Students/" & user_name it still just mounts Users. |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Jan 2002
Posts: 10,677
|
I believe that is a function (or curse) of mounts served from a Windows server. You could try and add a $ to the end of the user's name.
|
|
|
|
|
|
#7 | |||||||||||||||||||
|
League Commissioner
Join Date: Jan 2005
Posts: 8,475
|
From the Applescript dictionary:
|
|||||||||||||||||||
|
|
|
|
|
#8 | |||||||||||||||||||
|
Prospect
Join Date: Jun 2007
Posts: 5
|
Here is the whole AppleScript
There is a folder named Students in Users, but it returns with "It's not there" as if there is no such folder. Where would I put a $? Thanks a ton. |
|||||||||||||||||||
|
|
|
|
|
#9 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
I am not quite grasping something here, and sometimes I just need to be told something flat out.....Are you ultimately trying to map Home directories? From a server? What type with what OS?
There are many other ways to do this with out apple scripting, that is why I ask. Also, do the users authenticate to some sort of directory service or locally on the machine? |
|
|
|
|
|
#10 |
|
League Commissioner
Join Date: Jan 2005
Posts: 8,475
|
Try something like this:
Code:
mount volume "afp://192.168.0.101/volumename" as user name "username" with password "yourpassword"
|
|
|
|
|
|
#11 |
|
Prospect
Join Date: Jun 2007
Posts: 5
|
The students have server space on our "files" server. They are not trying to map home directories. This will be used on Mac OS X machines.
This script maps to the network share, but it is only seeing one directory deep for some reason. It only sees the first directory regardless of what volume I mount. They authenticate to a directory service, but log into the machine locally. |
|
|
|
|
|
#12 |
|
League Commissioner
Join Date: Mar 2003
Location: Bay Area, CA
Posts: 11,352
|
these shares require authentication? Or is there no ownership involved?
you can try mount afp://%user%@ip.of.share/path /mount/path but why not use the directory service to push out the shares? |
|
|
|
|
|
#13 |
|
Registered User
Join Date: Jun 2007
Posts: 1
|
I'm not sure why he would want to do something like this, but I work in an environment where we don't login to the machines individually. So thanks to your help I have a script now that lets me mount a users home directory after they run the script and type in their user name and pass. Thanks everyone.
At this point I am really happy with it, I'll simply put it on the desktop of all the machines and teach everyone how to use it, much easier then browsing to the server... Anyone know if its possible to have the username and password be one dialog box and not 2? to getusername() display dialog "Enter your username:" default answer "" set username to text returned of result return {username} end getusername to getuserpwd() display dialog "Enter your password:" default answer "" with hidden answer set userpwd to text returned of result return {userpwd} end getuserpwd set username to getusername() set userpass to getuserpwd() tell application "Finder" open location "afp://" & username & ":" & userpass & "@172.16.100.11/" & username end tell |
|
|
|
![]() |
|
|