Trigger and task combination? Is it possible?

I recently downloaded a very useful app called Peek. It allows me to call ChatGPT with just a shortcut. This app works with all LLMs, such as Gemini, Claude, Perplexity, and more.

I want to create a Keyboard Maestro Shortcut that will open this app and paste a prompt into it, allowing me to type and copy the generated content. Is this possible? Here are the steps:

  1. Trigger the shortcut to bring the Peek app to the front with the automatic prompt already typed.
  2. Type the text to be rewritten and copied.
  3. Paste the text elsewhere.

I would appreciate any help

I don't understand this part: "With the automatic prompt already typed." But then you say "Type the text to be rewritten and copied."

Can you explain what the automatic prompt is? And how, if it's the question you're asking the LLM, how it's already typed? And if it's already typed, what do you need to rewrite? I'm quite confused.

I've looked at Peek, and it's not going to be simplistic to work with, as it doesn't seem to have a command line interface nor AppleScript support. To get text into it will require some GUI clicking and/or key pressing, and to get data out, it will probably require a found image click.

But I can't even really start looking at that until I better understand the usage. Can you answer the questions above?


OK, you will know how to do that bit..

Most of us here will not have used Peek. A quick Web search does not show me any images that help me imagine what you are typing about. It would help if you supplied an image, further description, and a note of any attempts you have made so far to tackle this.

It sounds as though you would be using an Insert Text by Typing action. I would guess that you have the text stored in the system clipboard or in a variable. What have you come up with so far for this step?

So that sounds like a Paste action following a Copy action. I would guess that the copying part is the challenge.

So... have you actually started work on a macro? Let's see it. Can you be more specific about what particular challenges there are for your macro? Please see "Posting Your Question or Issue to the Forum" for tips.

1 Like

You can pursue this path, using Peek, and people will help you, but personally I just plan to wait until the next version of macOS Sequoia which will have direct and free support for ChatGPT (although it appears that Sequoia will still allow you to pay ChatGPT for better services. Presumably the optional fee gives you better service.)

There's a real chance (I'm hopeful, but expect to be disappointed) that Apple might provide an API to allow users like us to submit questions to either Apple Intelligence or ChatGPT, and if we're really lucky, it might allow us to also copy the responses back. I think if thousands of users pester Apple for this feature, they might give it to us. But in fact, Apple already provides an interface to Siri called "Type to Siri" and this was one of the very first things they mentioned during the AI portion of their WWDC 2024 Keynote, so I am hopeful that enhancing this is on their TODO list.

Check out the statement at 1:17:47 in this video. To be honest, the moment I saw this, I was hoping that they were planning to release an API for this feature. But I've been hoping for this for many years. (The demo is for the iPhone, but this feature also exists on macOS.) Apple also said that a similar feature for users to access ChatGPT would be coming "later this year" but they did not say if that was BEFORE or AFTER the release of Sequoia. (Probably after.)

P.S. I'm guessing that when you wrote "3. Paste the text elsewhere" you were talking about the response from Peek, not the questions you submitted to Peek. Am I right?