• Welcome to Mac-Forums. You must Register (free) before posting. To view discussions, select the desired subject forum(s) below.

How to create "AUTOMATOR - QUICK ACTION" to post a Picture on Twitter

Joined
Jun 10, 2008
Messages
122
Reaction score
0
Points
16
Hello All,

I come across a lot of pictures I want to post on Twitter, and instead of going up to the "Share" button on the toolbar, I was wondering if there was a way to write an Automator Quick Action that would just launch a New Twitter Window, and put the picture I Right-Clicked on, in the new Tweet.

Thoughts?

Thanks,

J
 
Joined
Sep 30, 2007
Messages
8,380
Reaction score
344
Points
83
Location
The Republic of Neptune
Your Mac's Specs
27" 2019 iMac
This should be possible. I don't use Twitter and it's not in my own "Share" menu, so I can't work out the specifics, but if you can walk me through exactly how you do it now, step by step, I should be able to work it out.
 
Joined
Jun 10, 2008
Messages
122
Reaction score
0
Points
16
This should be possible. I don't use Twitter and it's not in my own "Share" menu, so I can't work out the specifics, but if you can walk me through exactly how you do it now, step by step, I should be able to work it out.
I agree, it should be pretty simple.

For the sake of simplicity (of explanation), just think of it like I'm trying to "Message" a picture to someone I know, from my iMac (same concept).

  1. Select the picture in question
  2. Go up to the "Share" icon on the top menu bar of the Finder window I'm in, and click on said icon
  3. Then select "How" I want to share it...for the sake of simplicity, let's stick with "Messages"; so I'd click on that.
  4. The messages app would boot and the picture would be put into a new message, and all I'd have to do is select the recipient

Now that you have the gist of the situation....I want the same functionality, but with Twitter.
When I DO Select a picture, go up to the Share icon, click on Twitter, it opens a very minimal Twitter window, inserts the picture and that's that; I'm good to go.

I want to be able to Right-Click on a picture, have the Context Menu appear, and under "Quick Actions", have Finder/Automator accomplish the same thing as if I'd gone up to the "Share" icon at the top of the Finder window and selected "Twitter" to share said photo.

Thanks for any help/insight you might have.
 

Slydude

Well-known member
Moderator
Joined
Nov 15, 2009
Messages
15,126
Reaction score
315
Points
83
Location
North Louisiana, USA
Your Mac's Specs
2.8 GHz 2008 MacBook Pro 10.11, 8 GB mem, iPhone XS, 2015 iMac 16 GB 10.15.5 beta
OK. I get what you are trying to do. A lot of whether or not this can be easily done depends upon whether the Appropriate Automator actions are available to interact with Twitter.

When you open the minimal Twitter window to compose a tweet what app are you using?

What version of macOS are you using? I see some early Automator actions for Twitter but many them are quite old so they probably do not work with current versions.
 
Last edited:
Joined
Jun 10, 2008
Messages
122
Reaction score
0
Points
16
OK. I get what you are trying to do. A lot of whether or not this can be easily done depends upon whether the Appropriate Automator actions are available to interact with Twitter.

When you open the minimal Twitter window to compose a tweet what app are you using?

What version of macOS are you using? I see some early Automator actions for Twitter but many them are quite old so they probably do not work with current versions.
I'm using Catalina 10.15.5

I've attached a video of EXACTLY what I'm trying to do (but via the Context Menu/Automator).

Dropbox - Iris 6-21-20.mov - Simplify your life
 
Joined
Sep 30, 2007
Messages
8,380
Reaction score
344
Points
83
Location
The Republic of Neptune
Your Mac's Specs
27" 2019 iMac
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:


  1. Have a Finder window open and a sample image already selected and ready to act on.
  2. Create a new Automator document and select Quick Action as the type of document.
  3. Set "Workflow receives current" to files or folder"; set "in" to Finder. Set image and color to your preference.
  4. 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.
  5. 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.
  6. 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.
 
Last edited:
Joined
Aug 2, 2011
Messages
1,719
Reaction score
56
Points
48
Location
Tyneside, UK
Your Mac's Specs
MBP Retina mid 2015 15.4" 16GB 2.5 GHz OS Catalina; iPhone 7 128gb; iPad Mini 2, 32gb
A maximum of four images is allowed in any one tweet. I find the easiest way is to start a tweet, open photos, select photos with Cmd key, then click and drag. This is the same as I do for facebook tho' there is no limit of images in a starter thread on that platform; single in a reply.
 

Slydude

Well-known member
Moderator
Joined
Nov 15, 2009
Messages
15,126
Reaction score
315
Points
83
Location
North Louisiana, USA
Your Mac's Specs
2.8 GHz 2008 MacBook Pro 10.11, 8 GB mem, iPhone XS, 2015 iMac 16 GB 10.15.5 beta
Nice work LB . I've done a bit with Automator in the past so I know that took a bit of time to work out.

I haven't tried the Watch Me Do action under Catalina but in the past it has been a little "twitchy" to work with if the starting parameters change at all so your warning about choosing the correct starting point is important.

The base installation of Automator does not include Twitter-related actions though there are some on thread-party Automator-related sites. Perhaps if I dig a little deeper I can find some that are relevant. I haven't looked at new Automator actions in a while but at one point it seemed that new ones were not appearing very often. It seems to be an idea that's withering on the vine so to speak.

×
 
Joined
Jun 10, 2008
Messages
122
Reaction score
0
Points
16
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:


  1. Have a Finder window open and a sample image already selected and ready to act on.
  2. Create a new Automator document and select Quick Action as the type of document.
  3. Set "Workflow receives current" to files or folder"; set "in" to Finder. Set image and color to your preference.
  4. 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.
  5. 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.
  6. 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.
Wow!....Thanks a lot, LifeIsABeach!
That's great. Thank you very much for the taking the time to figure that out and to walk me through it!
I greatly appreciate it!
 
Joined
Jun 10, 2008
Messages
122
Reaction score
0
Points
16
Hi jman995x

How about giving the thumbs up to Lifeisabeach. Good work from him.

Ian
I did right when I replied and got a pop-up screen stating something to the fact that "hopefully you'll reach the same level" (can't remember).
But I did hit the little "Thumbs Up" icon in the lower left corner of his post.
I'll try it again right now.

- - - Updated - - -

Okay, I just tried and got this message:

"You cannot give Reputation to the same post twice."
 

chscag

Well-known member
Admin
Joined
Jan 23, 2008
Messages
60,388
Reaction score
746
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 7+, iPhone 8, Numerous iPods, Catalina
Always make sure to add comments to the "Thumbs Up".

I've noticed a lot of rep that are given are done so with no comment at all. We do like to see comments made as that shows a greater depth of gratitude. :)

And by the way, when we implement our new software, there will be a different method of giving rep. It will be in the form of "Likes". We will explain all that later as we test the new software.
 

Slydude

Well-known member
Moderator
Joined
Nov 15, 2009
Messages
15,126
Reaction score
315
Points
83
Location
North Louisiana, USA
Your Mac's Specs
2.8 GHz 2008 MacBook Pro 10.11, 8 GB mem, iPhone XS, 2015 iMac 16 GB 10.15.5 beta
If you got the message about not being able to give reputation to the same person twice, that means that your first attempt was successful.

×
 
Last edited:
Top