How can I wait until after I'm done taking a screenshot to trigger the next action?

I want to take a screenshot of different size tables and charts on my screen and send them to an apple note for study later. As long as I have the specific note open, I can use the "send shortcut to specific app" action to send CMD+V and paste into that note. I like this because BTT does it without actually showing the Notes app on my screen so it doesn't interrupt my workflow. Right now I will push a hotkey to take a screenshot, grab whichever part of the page I'm interested in, and then activate my BTT trigger to paste into my note.

I am wondering if I can use a single trigger to take the screenshot and then paste it into my note. The problem is I need BTT to wait until after I have my screenshot to move to the next action. Is there a way to make it so that the screenshot being taken activates the next trigger? Alternatively, if there is another route to achieve my goal that would be great too! Thanks!

1 Like

I, too, long for the day when BTT triggers can be event-driven.

Until then—if you're using macOS Monterey—an alternative might be to trigger a Shortcut (inside which you could run "/System/Applications/Utilities/Screenshot.app/" from an inline shell script), after which you could either paste the screenshot from the clipboard or from a saved file.

1 Like

If it's ok to create a new note with the screenshot and not attach it to an existing one, you can easily use the "Capture Screenshot (Configurable)" action and select "After Capture: Open in other application". Then select the Notes application:

If you need to attach it to an existing note, that should also be possible using that action, but I need to lookup the correct Apple Script to run for this.

But yes, in general I would also recommend the Shortcuts app on Monterey, which can easily be triggered from within BTT and in general works great with BTT.

1 Like

Thanks for the reply! The ideal would have been to send the screenshot to a note that I'd previously specified, but your first solution still works pretty well, thanks!

As far as the shortcuts method, unfortunately "append to note" can only send text (if you try to append a picture it will show as "IMG_1234"), which is why I had the idea to try capturing my screenshot to clipboard and then sending "CMD+V" to notes - to get the actual image. But to do this I needed BTT to wait until I was done taking the screenshot to send the paste command.

But like I said the first method is pretty close, thanks again!

You could execute the cmd+v trigger after capturing, using the "execute terminal command action".

The fastest way is to execute an Apple Script that executes a named trigger inside of BTT. These can be configured in the "Automations, Named & Other Triggers" section in BTT:

This script would trigger a named trigger with the name "your_trigger":

/usr/bin/osascript -e 'tell application "BetterTouchTool" to trigger_named_async_without_response "your_trigger"'

1 Like

@Andreas_Hegenberg It would be awesome if the 'After capture' section of 'Capture Screenshot (Configurable)' gave us an option to directly pass it to an Apple shortcut; that would make this workflow way more powerful (without having to resort to hacking that functionality via terminal commands)


As a workaround in the meantime, we can use the shortcuts CLI in the terminal:

Something like:

# After capture
shortcuts run 'my shortcut'

And then in the Apple Shortcut 'my shortcut', we could have it set to receive data from the clipboard:
image

shortcuts Help

⇒ shortcuts -h
OVERVIEW: Command-line utility for running shortcuts.

USAGE: shortcuts <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  run                     Run a shortcut.
  list                    List your shortcuts.
  view                    View a shortcut in Shortcuts.
  sign                    Sign a shortcut file.

  See 'shortcuts help <subcommand>' for detailed help.

shortcuts run Help

⇒ shortcuts run -h
OVERVIEW: Run a shortcut.

USAGE: shortcuts run <shortcut-name-or-identifier> [--input-path <input-path> ...] [--output-path <output-path>] [--output-type <output-type>]

ARGUMENTS:
  <shortcut-name-or-identifier>
                          The shortcut name or identifier to run.

OPTIONS:
  -i, --input-path <input-path>
                          The input to provide to the shortcut.
  -o, --output-path <output-path>
                          Where to write the shortcut output, if applicable.
  --output-type <output-type>
                          What type to output data in, in Universal Type Identifier format.
  -h, --help              Show help information.

Use this terminal command to directly send the file to shortcuts:

/usr/bin/shortcuts run yourShortcutName --input-path {filepath}

Then you don't need to rely on clipboard:

@Andreas_Hegenberg In my use case, I don't want to write the file to disk at any point, which is why I am using the clipboard.

My full workflow (which works; the 'Run Shell' is a hacky workaround since Apple Shortcuts fails to copy the marked up image back into the clipboard otherwise)


But also, my feature suggestion above of being able to directly choose a shortcut as the 'After capture' rather than having to go via the Terminal would make this 'bridge' to Apple Shortcuts way easier to use for the less technically inclined power user.