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.

2 Likes

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.

1 Like

Thank you! This Word snippet works perfectly on my Mac Studio/Ventura. Why not add it to the official Extensions page?

Great to hear!

Why not add it to the official Extensions page?

The simple answer is I have made so many snippets on the forum it would take weeks and weeks to add them all to the extensions page (with proper icons, documentation, and testing). And then all the ones requested and not made yet would take further months or years. Plus, once it’s “official” on the page, there is an extra burden of keeping it maintained, tested, and updated…

Instead of endlessly and miserably cranking out extensions to the directory, I’m focusing on

  1. Improved tools for users to make their own extensions (beginning with snippets and moving on to easier-to-use tools)
  2. Later, a new extensions directory will be much faster and easier to update and for both me and (hopefully, if it works out) others to add things to
  3. Oh yeah, and maybe improvements to the app itself if I ever get to that… :slight_smile:

I think, in the long run, this is for the best. Maintaining the directory is quite a chore, and empowering regular users to make and share extensions is a better use of time.

2 Likes

:100: agreed! :slight_smile: