-- /! GET THE PATH OF THIS SCRIPT !\-- set myPath to path to me as text --display dialog myPath
-- /! CREATE THE FULL PATH OF THE PREFERENCE FILE !\-- set PrefPath to myPath & "user.txt" --display dialog PrefPath
-- /! CHECK IF THE PREFERENCE FILE IS HERE !\-- set msg to "no" tell application
"Finder" set msg
to "yes" display dialog "What is your username at brunel ? (This is the same as your mailbox)" default answer "" buttons {"OK"} default button 1 set username to text returned of result tell application "TextEdit" activate make new document quit saving no end tell --display dialog msg
-- /! READ THE USERNAME !\-- set the_file to PrefPath as alias open for access the_file set username to read the_file close access the_file set VolumePath to "smb://acfs5.brunel.ac.uk/eepg/" & username & "/"
-- /! CONNECT TO VOLUME AND OPEN A FINDER WINDOWS TO THIS VOLUME !\-- tell application
"Finder" mount volume VolumePath end try end tell
delay 2
tell the application "Finder" set w to make Finder window to disk username end tell |
---|