-- -- Define variables -- -- STRING LIST, all network shares to work with set disk_list to {"share1", "share2", "share2"} -- STRING, prefix to the network shares (for NFS only) set disk_prefix to "/usr/local/symlinks/nfs" -- STRING, server hostname (use IP if not using SMB) set server to "192.168.0.2" -- STRING, protocoll, e.g. "smb://" or "ftp://" set protocoll to "nfs://" -- -- Program part -- tell application "Finder" -- get every non-local disk set all_disks to every disk whose local volume is false -- set variable for mounting set already_mounted to false -- go through all found disks ... repeat with current_disk in all_disks try -- ... and check, if names match with defined shares if name of current_disk is in disk_list then eject current_disk -- as we found at least one mounted share, no need to remount (all) set already_mounted to true end if end try end repeat -- check if in the preceding action any drive from was unmounted if already_mounted is false then -- go through disk list and mount every 'volume' from 'server' with 'protocol' repeat with volume in disk_list try -- build string for mount path to server share set mount_path to protocoll & server & disk_prefix & "/" & volume mount volume mount_path end try end repeat end if end tell