-
All replies
-
Helpful answers
-
Jan 3, 2016 5:09 PM in response to TommyJayby Roote,Hi TommyJay. There is a really useful menu bar app by appgineers called Mountain that will let you eject and remount individually or by group. It has configureable preferences including global hotkeys.
-
Jan 3, 2016 5:20 PM in response to Rooteby TommyJay,Thanks for the tip, Roote. I wouldn't even mind that it's a paid app, but the main reason I want to do it with automator is because can simply launch the app through Flic or Unified Remote or iCal. I love how automation can do simple things, like unmount drives when I'm leaving, and I'd also like to do something like 'triggering an app' to mount them back when I come back... The Mountain app seems great with it's keyboard shortcuts, but for example I can't make iCal do a key stroke, but it can open an app..
-
Jan 3, 2016 7:47 PM in response to TommyJayby Roote,To use iCal with Mountain, first set your global hotkey in Mountain. For instance, to mount your drives you might use Shift-Option-Command-M.
In Automator create a new Calendar Alarm and add a Run AppleScript action to the workflow. Add the following lines:
tell application "System Events"
keystroke "m" using {shift down, option down, command down}
end tell
Save it with a name such as Mount Drives. An Automator calendar and the event will be automatically added to the Calendar app. In Calendar schedule the event to your preference.
As far as Flic and Unified Remote, if you use those programs to launch apps, be aware that you can create an Automator app using the Run AppleScript action and also save an Applescript as an app from Script Editor.
To use either app In Calendar, create a new event, select Custom as the alert, Open file, Other, and select either the Automator app or AppleScript app you created.
-
Jan 9, 2016 1:40 PM in response to Rooteby TommyJay,@Roote, I thank you for the time you took to go through it and explain everything to me. Nevertheless, it seems like a workaround, not a solution. My goal was to use only simple Automator, and you found a way to use a third party app to work with automator.
-
Jan 10, 2016 4:28 AM in response to TommyJayby Roote,You're welcome. No problem, I understand. With the drives connected you want to mount, run the following command in Terminal to list them and locate the Device Identifier for each device (i.e disk1, disk2, etc.):
diskutil list
You'll see a list of drives similar to this:
In the example above disk0 is the internal boot drive, disk1 and disk2 the connected external drives.
Once you have the Device Identifier for each drive (i.e disk1, disk2, disk3, disk4) you can try this simple Automator workflow/application/etc using a Run AppleScript action:
on run {input, parameters}
set diskutil to "usr/sbin/diskutil"
do shell script diskutil & " mountDisk disk1 > /dev/null 2>&1 &"
do shell script diskutil & " mountDisk disk2 > /dev/null 2>&1 &"
do shell script diskutil & " mountDisk disk3 > /dev/null 2>&1 &"
do shell script diskutil & " mountDisk disk4 > /dev/null 2>&1 &"
return input
end run
Alternatively you can use a faster Run Shell Script action in Automator:
diskutil mountDisk disk1 > /dev/null 2>&1 &
diskutil mountDisk disk2 > /dev/null 2>&1 &
diskutil mountDisk disk3 > /dev/null 2>&1 &
diskutil mountDisk disk4 > /dev/null 2>&1 &
Tested with OS X Yosemite 10.10.5 and OS X Mavericks 10.9.5









