Macro to send text to the Scrivener system wide Scratch Pad

Hello,
Scrivener contains a very useful **system wide ** Scratch Pad which is turn is designed to send Scratch Pad notes to any Scrivener document or project.
I am unable to find any way to send highlighted text to the Scrivener Scratch Pad. it could not be done via the Scrivener menu because the scratch pad works system wide, and it is not a Scrivener service.
Thanks in advance for your time and help

You can drag stuff (images, text, links, …) to the Scratch Pad:

Before you have to create a new not with the Plus button.

There’s also a Service which lets you make a new clipping (but not a add to the Scratch Pad):

1 Like

thank you Tom.
I had see both of these: drag and drop into scratch pad and make new clipping.
I was looking for a way to highlight text and send it to the scratch pad.
thanks for thinking about it.

Scrivener is not AppleScript-able, so your best bet will probably be to fiddle around with UI scripting (KM or AppleScript).

OK, with this you can add text to the text area of the Scratch Pad:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set textToAdd to "Test Text"

tell application "System Events"
  tell application process "Scrivener"
    tell window "Scrivener Scratch Pad"
      tell splitter group 1
        tell scroll area 2
          tell text area 1
            set value to value & linefeed & textToAdd
          end tell
        end tell
      end tell
    end tell
  end tell
end tell

A note (in the upper part) must be selected.

If you connect the variable to KM you should be able to build a KM macro around that.

2 Likes

I will work on it. Thanks very much !