Wait for a Volume to Mount or Unmount/Eject in AppleScript

In working with Alfred, I've created a workflow that loads files from a Volume (DMG) file. In order for this to work correctly, I need the script to wait until the volume is actually loaded and visible in Finder before continuing. This can be done a few different ways, but here is the AppleScript code I'm using which works with Alfred or Keyboard Maestro. It's based on several examples I found. The first script gets the name of the mounted volumes and keeps looping until the expected volume shows up in the list. The second script is the opposite. It keeps looping and trying to eject the disk until the name isn't in the list of mounted volumes. Wait for Volume to be Mounted set mountedDisk1 to list disks set thevolume1 to "Insert Volume Name Here" set wasmounted to false set counter to 0 set max_number_of_iteration to 30 –activate –use activate to bring dialog to front if mountedDisk1 contains thevolume1 […]

It’s all about templates, macros and workflows in 2020

Over this holiday break I have been excitedly playing with Alfred and Keyboard Maestro to the point where I might be wasting time trying to find ways to save time. In reality, I've created multiple workflows in each application to accomplish some trivial, but still useful tasks. While looking up some examples for Keyboard Maestro, I followed the demo and set my machine to empty the system trash every Friday night at 10pm. Yes, the system does it, but this is more efficient. I took that idea and set Keyboard Maestro to empty the trash in DevonThink Office at the same time. Keyboard Maestro can enter keystrokes and press dialog buttons. That's nice! It even adds the extra option to make sure the system was idle in case I was doing something. Because I've done it more than once manually, I built a Keyboard Maestro workflow to copy files out of my Dropbox folder to my local system so they […]