Ah, ok. You are doing this from Finder. I was thinking it was from Safari. I did a little experimenting using "Notes" as my sharing option. I thought this would be dead easy by simply adding a keyboard shortcut to activate the existing menu item, but that doesn't work at all. There are no Automator actions or variables to access that menu either. An Applescript likely could be written, but I don't know how to do those. HOWEVER! There is a "Watch Me Do" feature of Automator that will get the job done. So, do this:
- Have a Finder window open and a sample image already selected and ready to act on.
- Create a new Automator document and select Quick Action as the type of document.
- Set "Workflow receives current" to files or folder"; set "in" to Finder. Set image and color to your preference.
- Here's where you will hit the red Record button up top. When you do this, you'll automatically switch to the last open application and get a floating window to stop recording. So, make sure your Finder window with your sample image is the last open window so you are ready to go.
- Click that Record button. You'll get switched to your Finder window with your sample image, so immediately click the Share icon in the Finder menu, then click on Twitter. If you consistently add the same message to every image you share this way (or no message), then keep going and click Share when done. Then click the Stop button on the floating window.
- You should now be back in Automator. See my screen cap below for what you'll see if you stop to after the image is selected to type a custom message each time. Note the slider that says Playback Speed. Crank that to 10x so that when you run the workflow, it goes faster for you. Note that you may have to run through this process a few times to make it go smoothly. I don't believe that you going physically faster through the motions will help. Automator is watching what you are actually clicking on, not mimicking the exact mouse movements like other software will do. There is a timeout setting, so adjust that if you find it's not catching everything you do.
View attachment 31742
Now, the next step is activating this workflow quickly and easily. You will see the action in Finder's context menu (right-click) under
Services. The actual Automator file can be found in
yourhomefolder/Library/Services. The best thing here is to assign a keyboard shortcut to activate it. Go to
System Preferences » Keyboard » Shortcuts » App Shortcuts. Select
Finder on the right, then click the + icon to add a new shortcut. The title is the name of your new action (for example, I named mine
ShareImage), then assign a keyboard combination that ideally is not in use. If you choose something already used, your choice will override the existing one.
And this should do it for you. As I mentioned earlier, I think this can be done more effectively with an Applescript, but I'll have to leave that to someone else more knowledgable to chime in on, if that someone else comes along. Also, if you would rather run this from an icon set on your Finder toolbar for one-click access rather than using a keyboard shortcut, that is doable also, but you'll have to save the Automator workflow as an "Application" rather than a "Quick Action". Once saved, have a pair of Finder windows open; edit the toolbar in one, drag the app to the toolbar from the other while it's still in edit mode.
One more thing to be aware of is that Catalina will nag you a couple times to authorize permissions in
Security & Privacy.