New Word document with text

How to open an application with a Popclip extension and auto-paste text into this app?

Example: MSWord installed, I want to build an extension Copy and Open MSWord, then paste the selected text.

Thanks for support and sharing.

1 Like

Hi and welcome to the forum :slight_smile:

For opening MS Word, you would want to use an AppleScript extension.

I can’t put one together right now, but a similar example is the BBEdit extension (source)

The exact AppleScript will vary for Word, of course. I’m not sure if is supports the “make new document with text” command, etc.

Maybe that will point you down the right path, or perhaps someone helpful will come in with a worked-up solution.

Here’s a good start:

#popclip
name: Send to MS Word
icon: W
applescript: |
  tell application "Microsoft Word"
    activate
    create new document
    insert text "{popclip text}" at end of text object of active document
  end tell

(The above block is an extension snippet - select all the text above to install the extension with PopClip)

Figuring out an app’s AppleScript incantation to do a particular thing is weirdly hard – hat tip to MacScripter / MS Word Insert Text for the Word insert syntax here.