iCloud Drive stuck uploading and downloading files in Mac OS X Mojave

Recently, my MacBook Pro, running Mac OS X Mojave, got into a state in which the Finder wasn’t uploading or download files to and from iCloud Drive. Since I couldn’t find any solution to this through Googling, I wanted to document how I solved the problem for others who may be experiencing the same.

I think, but can’t be sure, that the problem was related to allowing GitHub Desktop to store my repositories in the “Documents” folder, which is synchronized with iCloud Drive.

One of my repositories had literally tens of thousands of files, and even though I had deleted it long ago on my Mac, I discovered through troubleshooting that it was still present in iCloud Drive, when accessed via the web.

To solve the problem, after moving my GitHub folder outside of Documents, I then backed up all the files in Desktop and Documents on my Mac that I need, and disabled “iCloud Drive” in the iCloud area of the system preferences, and instructed the Mac to delete all the local files.

I then went into iCloud Drive via the website, and started deleting everything from there.

Step one was selecting my repo folder in Documents, and deleting it.

Step two was going into “Recently Deleted”, and then purging the folder from there.

But this turned out to be very confusing, because although the purging of the repo folder appears immediate in the browser UI, it’s actually a very long process that’s happening—in the browser! While that’s going on (with no UI feedback) other files and folders in “Recently Deleted” area appear grayed out. You can select them, but you can’t delete them.

After a while of frustration, an error message popped up saying certain files in my repo folder couldn’t be deleted, at which point the folder re-appeared in the “Recently Deleted” area. Ultimately, I had to go into the folder, and delete its contents in small batches. Once that whole folder was deleted, the grayed out files and folder then lit up, and could be deleted themselves.

So the fact that deletions are getting processed one by one in the browser, but there’s no UI to indicate that, can cause terrible confusion when trying to perform the kind of mass cleanup that I was doing.

In the end, when everything was finally deleted and purged, I re-enabled iCloud Drive on the Mac, and everything returned to normal.

How to selectively run Keyboard Maestro macros in a synchronized environment

A challenged I’ve always faced in running Keyboard Maestro on multiple Macs, is the maintenance of macros that are common to all, i.e. when updating a macro on one machine (say, changing the API keys of a service I’m accessing), I have to remember to go make the same updates on the others.

Keyboard Maestro provides a solution to this problem, by allowing you to synchronize your macros across multiple machines. Their implementation, however, and in contrast to say, Hazel’s folder-scoped implementation, is all or nothing—meaning that you can’t have macros on one machine that don’t exist on the others. And that can become a problem, especially with macros that are scheduled to run periodically.

Keyboard Maestro provides two approaches to address this problem:

The first is the ability to, for any given group (folder) of macros, to click, “Disable on this Mac”.

Unfortunately, there’s a number of shortcomings to this option. For example, anytime you add a new group of macros to a given machine, you have to remember to potentially go around disabling them on the others.

The second approach, and better in my opinion, is to condition the execution of any macro on the UUID (universally unique ID) of the machine on which the macro is running. Here’s an example of how this works.

The first step is to maintain a macro that determines the UUID of the current machine, and defines a list of named UUIDs for machines you’ll later be referencing. I run the following macro daily, and whenever I add a new machine, I’ll add its UUID to the list of named machines by temporarily running the disabled action that copies the current machine’s UUID to the clipboard.

With this in place, I can now condition the execution of other macros by machine. The following is an example of a macro that runs daily, and quits FaceTime on my MacBook Pro.

If I wanted this macro to run on two machines, I could add a second UUID check, and change the condition to “any”.

While this approach requires additional effort in creating your macros, it provides big benefits in being able to manage from a single machine, the conditioned execution of macros on all of your machines.

How to perform a currency lookup in a Numbers spreadsheet

Apple recently introduced in the Numbers spreadsheet the ability to pull live stock prices from the internet, making it now possible to track portfolio performance.

To access this feature, you use the STOCK function:

Since the feature pulls data from the Yahoo finance service, the symbols you should use for reference are those used at Yahoo. For most stocks that I’ve come across, the symbols are the same as those used at Google, but they do seem to vary slightly for non-US stocks and currencies.

To track the Euro/USD exchange rate, the symbol used at Yahoo is “EURUSD=X”, but using this symbol in the Numbers STOCK function returns an error. The solution, as I found in this discussion at Apple is to use the CURRENCY function:

My awful experience installing Windows 10 in VMWare Fusion 8

In reviewing Lance’s performance at the Spanish national championship this past weekend, the GM trainer from Andalucia strongly encouraged us to buy “ChessBase” as a tool to keep up with the latest in opening theory. Since Lance already runs Windows 7 in VMWare Fusion—in order to run PlayChess and TeamSpeak—I didn’t expect there to be any issues installing ChessBase (which is only available for Windows.)

I was wrong. Trying to install ChessBase in Windows 7, I got an error that some C++ runtime was missing. I downloaded the runtime from the link included in the error message, but it wouldn’t install either.

Not wanting to waste time on all this, I figured the best way forward would be to just update to the latest Windows—i.e. Windows 10. And so began the following nightmare:

  1. When you go to the Microsoft store to buy Windows 10, you’re presented with three options—(1) Free upgrade for Windows 7, 8, or 8.1 (2) Buy Windows 10 (Download), and (3) Buy Windows 10 (USB – English). (I’m not sure why “English” is listed on the USB option…)
  2. Here’s what you see when you click the free upgrade option—a screen that suggests you buy a new PC, and provides zero information about how to upgrade. Heavy sigh, but having to jump through hoops to get something free didn’t strike me as surprising.
  3. Again not wanting to waste time, I decided to just buy the thing. And the purchase process turned out to be a lot more straightforward than the free upgrade process, as expected.
  4. After my purchase, I had to choose which version to download: Windows 10, Windows 10 N, Windows 10 KN or Windows 10 Single Language. Of course, there’s no explanation of what the differences are, so I just rolled the dice and chose the first.
  5. Then you have to choose “Home” vs “Pro”. Again, no explanation of the differences, so I just chose “Home”.
  6. Then you have to choose 32-bit or 64-bit. You’d think Google could help with this, but not really. Rolling the dice again, I just went with 64-bit. Bigger is better, right?
  7. I was then given a download link to an .iso file, and product number. I downloaded the .iso file, and used it to start the process of creating a new VM in Fusion 8. Fusion asked for the username, password and product number—all of which Windows later asked for again.
  8. When the Windows 10 installation window opened, it asked for the product number. I entered mine, and was told the number was invalid. Of course. After a bit of Googling, I learned that you actually don’t need a product number to install Windows 10 (Was my purchase for nothing?) so I clicked, “I don’t have a product number”.
  9. The next screen asked if I want to do an “Easy Install” or a “Custom Install”. According to Google, one shouldn’t touch the Custom Install!
  10. Clicking “Easy Install” led me to a screen saying that I’d booted my Windows machine from “Windows Installation Media”, and that I needed to disconnect that, reboot windows, and then re-insert the media when prompted. WTF!?! Now, you would think that somebody else would have ran into this, and you’d also think that VMWare Fusion themselves would have run into this while installing Windows 10, but the internet offers no solution to this problem.
  11. In desperation, and feeling I’d hit a complete dead end, I decided to give the dreaded “Custom Install” a try. I clicked that, surprisingly wasn’t asked to make any custom choices, and the Windows 10 installation proceeded to complete successfully. Un-believ-able.
  12. In order to get reasonable integration with your Mac, the first thing you have to do when a new VM boots is install “VMWare Tools”. Unfortunately, for me, the “Install VMWare Tools” menu item was grayed out. Google said the problem is that VMWare Tools requires a virtual CD-ROM device to be attached. (Why on earth?!?…) Unfortunately, in my case, there was no way to add a CD-ROM to the VM, because neither my MacBook Air nor Lance’s iMac have a physical CD-ROM! Trying to add one anyway using the “Auto-Detect” setting led to a boot error, “Can’t attach to the Sata 0.0 device”. And again, unthinkably, neither the VMWare website nor Google could seem to help!
  13. The solution, as I eventually discovered, was to manually download VMWare Tools (which of course comes with no README; just a bunch of .iso files), attach the Windows 10 VM’s CD-ROM device to the “Windows.iso” file included with the VMWare Tools manual download, boot the VM, and then install VMWare Tools manually from the attached “virtual CD-ROM”. Apparently, this was only needed on the first installation of VMWare Tools, and that in the future it’ll be able to upgrade itself without a virtual CD-ROM attached. We’ll see…

At this point, almost five hours later, I could finally install ChessBase under Windows 10, and provide it access to our shared network device.

To me, it seems absolutely crazy that it hasn’t occurred to anyone at VMWare to write up a tutorial documenting what I imagine is a common use case of someone wanting to purchase Windows 10, and then create a Fusion VM, with VMWare Tools installed.

Update—After posting this article, a couple other observations came to mind, illustrating just how crazy this Windows world is:

  • When you install MacOS, you’re shown a progress bar. The progress might not be accurate, but at least you’re shown the visual indication that something is happening. When you install Windows 10, you get a screen that shifts between dark and light blue (is it breathing?) and says, “We’ve got some great features waiting for you.” It’s not really clear that something is going on in the background. In fact, at some point, I clicked the screen just to make sure it wasn’t waiting for me to do that to continue!
  • The biggest hilarity happened when installing ChessBase. The first time you launch the app, it asks you to enter its product code. That’s normal. What’s not normal, though, is that it also asks you to respond, on the same screen, to a CAPTCHA! Can you imagine? An installer with a CAPTCHA! But it gets worse. All the letters in the CAPTCHA are capitalized, and the input field auto-capitalizes whatever you type in, which, OK, seems to make sense if they want to remove case-sensitivity from the operation. But here’s the thing—if you type in a lowercase letter, even though it gets upper-cased in the input-field, the lower-case letter gets sent to the validation, and IT IS case-sensitive! So even though it looks like you’re submitting an upper-case letter, you’re not! Insane!

How to switch wifi networks with Keyboard Maestro

In a recent blog post I explained how I secure my home network with a VPN. In that article, I also explained how I enabled external access to my home network, using the Slink software running on a Mac mini server, whose primary network interface is wifi connected to my ISP router, and second network interface is ethernet connected to my home gigabit switch.

This setup works great, but it did require solving a tricky problem:

My home wifi network (created by the AirPort Extreme) is called “Hacienda”, and the wifi network created by the ISP router is called “HaciendaOlive”. Since I want all my home devices connected to Hacienda, that network is given first priority over all other known networks on my iPhones, iPads, etc.

The problem is that that network priority list propagates to the Mac mini (and all my devices) via iCloud, and so anytime there’s a network interruption or the machine reboots, the Mac mini connects to the Hacienda wifi network (instead of HaciendaOlive)—which of course kills my external access to that machine.

What I need is that the mini, and only the mini, has HaciendaOlive set as its highest priority wifi network. But this doesn’t see to be possible, unless I’d be willing to disable iCloud on that machine.

My solution to this problem was a Keyboard Maestro macro which runs every five minutes, checking whether the computer is connected to the HaciendaOlive network, and if not, switching it to that network. This required researching some obscure AppleScript code, and so I thought I’d post the macro here for the benefit of others searching for how to switch wifi networks using Keyboard Maestro. The blurred text in the image, is the wifi network password.

Enjoy!