How Do I Pick an App from ShotBox Share Menu

The Mojave share menu is omnipresent.

The ScreenCapture below is taken from the Mojave native screenshot utility.

Moderator: Actually the screenshot is of the Josh Parnham - ShotBox annotation utility, which may be automatically invoked from the Mojave screen shot utility.

I have 2 questions:

1- is click at found image the only way to open the share menu ?

2- once I am in the share menu, I know how to pick one single item using the insert text by typing action. What would be the most effective KBM action to prompt the user after the share menu is open by asking 'do you want to email, send to Yoink or send to Evernote in other words type M for Mail, Y for Yoink and E for Evernote. I could do it using a Palette, but I think that is too complicated an approach.

thanks in advance for your time and help

can it be found using Press Button?
image

Is it scriptable? can it be found using:
https://forum.keyboardmaestro.com/t/front-window-analysis-tool-using-applescript-system-events-get-window-elements/

1 Like

The challenge here is to get a screenshot of the screenshot utility for use in KM Found Image Action.
I have tried and it is very difficult. The only way I found was to record a video.
Not sure how good of an image that will make for a KM Found Image Action.

IAC, I always consider KM Found Image as a last resort.

Given that we can script this tool in a shell script using "screencapture" command, I think that give some some good output options:

-M screen capture output will go to a new Mail message
-P screen capture output will open in Preview or QuickTime Player if video
-I screen capture output will open in Messages
-B<bundleid>     screen capture output will open in app with bundleid

If you need other output, then I would use "screencapture" to output to clipboard, and then insert in, or attach to, the other app or output device, using a KM Prompt, either "Prompt with List" OR "Prompt for User input" using a popup of output choices.

Will that work for you?

1 Like

Nice Guideline

1 Like

thank you both @JMichaelTX and @hello

  • @JMichaelTX is right when he says that shell scripts are the easiest way of creating ScreenCapture, but this is not a simple screencapture. It is the Mojave ScreenCapture with markup, the image annotation tool, so I cannot use the screenshot shell script (I read through all possible output options.

I found a solution using UI Browser and listening to @DanThomas ' excellent youtube video https://www.youtube.com/watch?v=C06EjbwKuY0&t=138s and I came up with the script below that works (it does click on share when I place the script in the macro after I complete my annotations) and allows me to choose mail, yoink etc by insert text by typing..

I have 2 problems:
1- I have still not resolved the problem above, ie how to ask the user to choose between mail, yoink or Evernote.
2- the script works but the screen flickers. By trial and error, I determined that activate application "screencaptureui" is optinal. The script works without it but the screen still flickers. Any idea why ?

thank you again both


activate application "screencaptureui"
tell application "System Events"
  tell process "Screen Shot"
    click button 11 of window "Screen Shot"
  end tell
end tell

add a User Input action to ask what to do (mail, yoink or Evernote)

@ronald, I am confused. I thought you were talking about how to automate the built-in Mac Mojave+ screen shot utility. When that utility is running it is NOT possible to issue any keyboard commands, like a hotkey to trigger a KM Macro.

So, I think you are taking about automating the third party tool Josh Parnham - ShotBox . Is that correct?
If so, obviously that is a completely different task. :wink:

Even so, I could not get your UI script to work properly. It did NOT click on the Shotbox (aka "Screen Shot") share button. How and when are you triggering the UI macro?

Also, it would be best to put all scripts in a Code Block, using "applescript" in this case as the language. I have updated your post to do this.

Once I can duplicate the clicking of the share button, I can move on to addressing the other requests you have.

@ronald, OK, after a reboot of my Mac I got the script to work.

Here's a macro with the script that allows you to pick the app to share to.
However, like so many macOS apps that have a dynamic menu, there is a 4-5 second delay after the popup menu is shown. It still works, there is just a delay.

There may be a workaround for that delay, but for now, this should get you started.
FWIW, SnagIt also has a Share menu, and, IMO, it is much smoother to do the screen capture, make annotations, and then share.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Automate Josh Parnham - ShotBox Annotation Tool [Example]

**Requires: KM 8.2.4+&nbsp;&nbsp;&nbsp;macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/1/1/118608de92b937b5828ef1db3e2f37ba91f92f41.kmmacros">Automate  Josh Parnham - ShotBox Annotation Tool [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---

### ReleaseNotes

This performs UI scripting of the Josh Parnham - ShotBox   annotation tool
to select the Share menu, and then the chosen app.
<img src="/uploads/default/original/3X/b/0/b01765cbdd427282a36b4a1dc78b5b44686085bc.png" width="613" height="1671">

thank you very much !

1 Like

Yes, my question was ill formulated. Sorry