Name

mount volume

Synopsis

AppleShare

AppleShare

Mounts an AppleShare volume (a machine where Personal File Sharing is turned on). The machine is specified as an afp URL string, such as is returned from the choose URL command. To avoid the dialog for choosing a particular volume, add the volume name as a second path element. To avoid the dialog asking for username and password, supply them as parameters or as part of the URL. A Windows server can be mounted using an smb URL. Returns a file URL (but no result if the volume is already mounted). If the syntax of the mount volume command is insufficiently flexible, consider using do shell script to call mount_afp.

Examples

-- this first one lets user choose, presents the "Select volumes to mount" dialog
set s to choose URL showing File servers
mount volume s as user name "mattneub" with password "teehee"
-- these next ones present no dialogs
mount volume "afp://matt%20neuburg:teehee@duck.local/OmniumGatherum"
mount volume "afp://duck.local/OmniumGatherum" ¬
    as user name "matt neuburg" with password "teehee"
-- this one presents username/password dialog and volume dialog
mount volume "afp://duck.local"

Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.