Use Floating Window to share with Google Drive

I try to implement a notch floating window in finder (imagine the notch on top of the button):

image

When I drag a file there (or if i click the button) I want to open the context menu of the dragged/ or currently selected file/folder and open "Share with Google Drive".

Unfortunately, when I use the "Show Context Menu for Selected Item" Action, it will show the context menu of the current folder instead of the selected file.

Edit: I think it's the same problem that is posted here and here but has not yet been solved.

I think this can be achieved by using the Apple Shortcuts app. Shortcuts offers an action "Share with Apps", I think the example from NotchMenuNew can be modified to do what you need.
I'll have a look !

Good hint. Unfortunately, this doesn't work for Google Drive. It can't be selected in the "Share..." menu (and also not added). All the options are in the context menu itself.

Ah that's stupid. Then this will probably be hard to achieve ;-(

Would copying to a specific folder in Google Drive work without using the context menu?

This shortcut works for me to copy the dropped files to "My Drive", is that what you need?
https://www.icloud.com/shortcuts/0501f04767ec4b0c948bab8145e3db58

You'd call it from the floating menu item like this:

No, I want to leave the file in the folder and just share the GDrive link. Unfortunately, I always have to change the access to "Anyone with the link" so it's some more steps.

I found a workaround though: Whenever I left click in finder for longer than 0.05 seconds, BTT will save the current cursor position.
The floating menu "button" is triggering a cursor reset. That will move the cursor back to where I dragged the file from. From then, I can use click actions and "find text" to navigate through all steps.

It's probably not the best solution to always store cursor position. I will observe if the performance of finder is decreasing.

Also: Is there a way to make "find text" to search continuously for some time? I now use a delay before searching, so the window can open but since it's taking something between 0.5 - 2 seconds, the delay is quite long. Something like "find text within 2 seconds" would be cool. I tried to implement it with a named trigger loop and a counting variable but I couldn't get it to work..

ah understood. You could probably use some command line utility like GitHub - glotlabs/gdrive: Google Drive CLI Client to achieve that in case the Finder solution doesn't work well. They recently added support for sharing files (Releases · glotlabs/gdrive · GitHub)

You can use the „wait for text to appear on screen" action for that.

Thank you! Did not know "wait for text to appear on screen"! :+1: