Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- Mount all available volumes specified in the "set gDiskList to" list (Line 23)
- OS X Mountain Lion (10.8.3)
- by Applehelpwriter.com, Mar 2013.
- *)
- ---------------------------------------------------
- global gDiskList
- global gMountList
- set gMountList to {}
- ---------------------------------------------------
- (*
- Replace the example volume names with your own volume names inside the curly brackets in Line 23 below;
- Names must be quoted and comma separated as shown.
- Spaces in names ARE allowed. You can name as many or as few volumes as you wish.
- *)
- set gDiskList to {"Buffalo 500GB", "Time Machine (FW800)", "External HD", "My Movies USB"}
- ---------------------------------------------------
- tell application "System Events" to get the name of every disk
- set mountedList to the result
- checkLists(mountedList, gDiskList)
- mountDisks(gMountList)
- ---------------------------------------------------
- on checkLists(list1, list2)
- try
- repeat with i in list2
- if i is in list1 then
- display dialog ("The disk " & i & " is already mounted!")
- else
- set end of gMountList to i
- end if
- end repeat
- end try
- end checkLists
- ---------------------------------------------------
- on mountDisks(list_n)
- try
- repeat with i in list_n
- set i to quoted form of i
- do shell script "diskutil mount " & i
- end repeat
- end try
- end mountDisks
- --EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement