Wanted: Macro to Pause Dropbox and Google Drive

I want to create a macro that toggles Dropbox and Google Drive synching on an off. I’m currently doing this manually before I do any live streaming. I need all the available bandwith I can get, and I don't want these two apps using bandwidth to sync. Does anyone know how to do this? Thanks.

I found part of the answer. I can use this Apple Script to pause and/or resume synching in Dropbox

tell application "System Events"
  -- Pause syncing
	click menu bar item 1 of menu bar 2 of application process "Dropbox"
	click menu item "Pause Syncing" of menu 1 of menu bar item 1 of menu bar 2 of application process "Dropbox"
	
	delay 2
	-- Now re-enable syncing
	click menu bar item 1 of menu bar 2 of application process "Dropbox"
	click menu item "Resume Syncing" of menu 1 of menu bar item 1 of menu bar 2 of application process "Dropbox"
end tell

Hey Michael,

Good for you for working with System Events to handle Dropbox. Most people don't want to work that hard...  :sunglasses:

I spent a long time trying to UI-Script Google Drive, and I found:

  • Google has made one nasty app.
     
  • Accessibility in it is broken.
    • I got things working, and then they'd fail on another activation.
      • This was grossly repeatable, so I finally gave up.

I finally used a combination of UI-Scripting and Keyboard Maestro's click at found image action to produce a macro that works reliably on my Mojave system. It's acceptably quick too.

You'll have to fiddle a bit to get an image that will work reliably, and you can Quick Look mine in the image well to see what I did.

Good luck.

-Chris


Google Drive ⇢ Toggle Syncing.kmmacros (27 KB)

Macro-Image

Keyboard Maestro Export

Hey Michael,

Does the script hang for about 6 seconds on Monterey?

I have a method to get around that if so.

-Chris

1 Like

Yes, it does. I'd love to hear about your workaround. Thanks.

That worked astonishingly well on Monterey. I simply replaced your image action with this one. Thanks!

1 Like

Chris, I hope you don't mind, but I combined my macro with yours. This new macro toggles synching on Google Drive and Dropbox. I use a Stream Deck key to trigger it. Thanks for your help!

Toggle Synching of Google Drive and Dropbox.kmmacros (29 KB)

Hey Michael,

Okay, here's how that works:

  • AppleScript UI-Scripting is used to find the position of the Dropbox icon in the menu bar.

  • Keyboard Maestro clicks it to open the menu and that prevents the hang.

  • Back to UI-Scripting to select the menu items.

It works very reliably on my Mojave system.

-Chris


Toggle Dropbox Syncing v1.00.kmmacros (7.6 KB)

Macro-Image

Keyboard Maestro Export

That is VERY cool! Works like a charm. Thanks so much.

1 Like