Automating Text Transfer to GPT with Keyboard Shortcuts

Hello,

I am looking to create a keyboard shortcut that would allow me to copy specific text (like the text from an article or other source). This same shortcut would then directly send the text to a GPT. Finally, I would like to automatically retrieve only the GPT's response, or do so via another shortcut.

Would you have a solution to automate this process with a shortcut? If it requires a custom setup, we could discuss further implementation.

Thank you in advance for your response.

Will

Some questions first:

  • Are you subscribed to a specific GPT at this time?
  • Do you have macOS Sequoia?
  • Do you want to select the text manually with your mouse and then press a hotkey as your trigger?
  • Do you have a method of doing this right now manually? If so, can you document how you do it so we can help you automate it?

First of all, thank you for your response.

I’m using ChatGPT Plus and MacOS Sequoia.

Currently, I copy the text and send it to my GPT. I then wait for its response, retrieve it, and paste it into a text field, which wastes time.

Ideally, I’d like to trigger GPT as soon as a text is selected, sending that selected text directly to the chosen GPT. Then, I would like to retrieve GPT’s response with another shortcut that inserts it directly into the text field I’m working in.

Do you think this is possible?

Looking forward to hearing back from you.

I know this is the Keyboard Maestro Discourse, but this exact PopClip extension came into my mind: OpenAI Chat — PopClip Extensions.

1 Like

Anything that you do manually, with your eyes and hands, is possible with KM, I always say.

What is "my GPT". Is that an app? Are you using the official Chat GPT App from OpenAI?

No, you don't want that. You would never be able to select text without the macro kicking in and taking control of your Mac away from you. Besides, it's extremely difficult to do that detection in Keyboard Maestro (as far as I can tell.) You probably want a mouse button or a keyboard key to trigger your macro to act upon the selected text.

What does "the chosen GPT mean?"

That's a cool looking utility. But it seems to require something called "API credits with OpenAI" which is a cost above and beyond the normal paid account.

That utility looks nearly perfect for him. And that utility works FAST. Probably much faster than anything I could write for him. I would like him to state his speed requirements before I write any solution for him. Any solution I write for him would be just as slow as if he did it manually. I would also like him to explain how he does it manually. His question assumes that we have Chat GPT and that we know how it works. Personally, I don't, so perhaps someone else can help him. (Actually, I trust OpenAI so I'm willing to download it. But when I run it, it says "Sorry we were unable to create your account" so I cannot write any macro.)

Using an API is likely the fastest and most reliable way, no matter which LLM we are talking about. Depending on what you do and which model you choose, API access can be much cheaper than any other paid access.

Yes, I agree. But he didn't say if "fast" or "reliable" were important. I've managed to download the app and register, but the app is EXTREMELY SLOW. It takes about a minute to see the reply get "typed". but maybe he's okay with that, because perhaps he wants this done when he's not at his computer and speed isn't an issue.

Merci pour le conseil.
L'extension Popclic est intéressante, mais ne va pas me faire gagner du temps, car elle ouvre uniquement la page de chatgpt. Alors que j'ai besoin d'ouvrir un GPT dédié à une tâche spécifique sur ChatGPT.

Ensuite, j'aimerais pouvoir récupéré le texte de ce GPT avec un autre raccourci pour l'intégrer dans un champs de texte, et je ne pense pas que Popclic le fasse. Mais il est certain que c'est un extension bénéfique pour d'autres actions quotidiennes.

The popclip extension does not open the ChatGPT page. You must be looking at something else.

Quand je parle de GPT, il s'agit d'un robot dédié à un tâche précise dans ChatGPT.
Par exemple :

  • J'Ă©change avec un internaute sur LinkedIn.

  • Il me pose une question dont je n'ai pas la rĂ©ponse immĂ©diatement.

  • Alors, je sĂ©lectionne sa question et l'envoie Ă  mon GPT (robot entraĂ®nĂ© Ă  rĂ©pondre Ă  des questions sur un sujet spĂ©cifique).

  • Je rĂ©cupĂ©rer sa rĂ©ponse et l'intègre rapidement dans le champs de texte de notre conversation.

Pensez-vous que cela pourrait être possible en fusionnant les capacités de Keyboard Maestro avec celle d'une autre extension et de l'API de ChatGPT ?

Merci pour vos retours

When I talk about GPT, it refers to a bot dedicated to a specific task in ChatGPT.
For example:

I’m chatting with someone on LinkedIn.

They ask me a question I don't have the answer to right away.

So, I select their question and send it to my GPT (a bot trained to answer questions on a specific topic).

I retrieve its response and quickly integrate it into the text field of our conversation.

Do you think it would be possible to achieve this by merging the capabilities of Keyboard Maestro with another extension and the ChatGPT API?

Thank you for your feedback

I have far too many questions about your process to be able to write any code to help you. Perhaps if you show a video of your process I might understand better.

I'm sending you the video by email. Send me a message : wilhelmassengo@gmail.com

Sorry, I don't even read my messages on this website, nor do I share my email address with other people. My philosophy is that all communication with me must be made through the public forums on this site. Is the problem that you don't know how to upload a video?

Write down, step by step, how you do that manually and how you then use the returned answer. Post those steps here and someone will (hopefully) be able to walk you through the necessary steps of making a macro.

And be complete, even when something is obvious to you. For example -- how do you "send it to my GPT"? Copy and paste into a dialog in another app? Right-click and select a service? Something else?

At the moment there are far too many things that you know but we don't for anyone to be able to help.

Yes, indeed, my video wasn't accepted.

So, I'll briefly describe what I want to achieve:

Imagine: you're on Gmail. A colleague sends you an email, and you want to respond quickly using ChatGPT, specifically with a GPT (a bot trained to respond to your emails).

To do this, you copy the colleague's text and send it to the GPT. Then, you copy the GPT's response before sending it back via email to your colleague. But you receive hundreds of emails per day, and you'd like to automate this process to respond quickly with this same GPT. In other words, you'd want a shortcut that allows you to open this GPT as soon as you select the text from your email, and another shortcut that lets you retrieve the GPT's response and integrate it directly into the Gmail text field. This would allow you to respond to all these emails quickly.

To propose a viable solution, would you need more details on this? If so, which ones?

So, I'll briefly describe what I want to achieve:

Imagine: you're on Gmail. A colleague sends you an email, and you want to respond quickly using ChatGPT, specifically with a GPT (a bot trained to respond to your emails).

To do this, you copy the colleague's text and send it to the GPT. Then, you copy the GPT's response before sending it back via email to your colleague. But you receive hundreds of emails per day, and you'd like to automate this process to respond quickly with this same GPT. In other words, you'd want a shortcut that allows you to open this GPT as soon as you select the text from your email, and another shortcut that lets you retrieve the GPT's response and integrate it directly into the Gmail text field. This would allow you to respond to all these emails quickly.

To propose a viable solution, would you need more details on this? If so, which ones?

And what we need is how you do this manually at the moment. That's the first step in almost any automation.

Basically, all of it. We need a description of what you do manually in order to understand, because there's a good chance very few of us have the exact same stuff you have, nor do what you do, so descriptions at a summary level don't help.

Translating what you've written, we need something more along the lines of this made-up workflow:

  1. Using Gmail in the Chrome browser, I select text in an email.
  2. I copy that text with Command-C.
  3. I switch to [what, another app? another browser tab? something else?] and hit Launch Bot.
  4. The Launch Bot dialog allows me to select the appropriate robot, and I choose Email Replier.
  5. In the Email Replier window, I select the Input box and paste the copied text.
  6. I click a Go button in [whatever that ChatGPT app/window is].
  7. After some time, a response appears. It shows up in a box labeled Answer Text.
  8. Within the Answer Text box, I press Command-A to select all the text, then Command-C to copy it.
  9. I switch back to Gmail, open a reply email, and paste the copied text in the body of the email

But for us, the big holes right now are how are you using ChatGPT—functionally, how do you get to it on your system when you're going to use it, and what precisely do you manually do on that page to process the text.

With a detailed guide like that, it becomes much more realistic to give you better answers.

-rob.

I use ChatGPT through its website on Microsoft Edge. With two screens, I keep ChatGPT open on the right screen at all times, while the conversation sites (LinkedIn, WhatsApp, Gmail) are on the left screen. My usage relies on specific "GPTs" dedicated to specific tasks, which I call upon about 150 times per day. Each request runs on the GPT-4 model, providing a response in just about two seconds.

Here’s my process for handling text: I select the text from the relevant conversation on the left screen, copy it with Command+C, and then paste it into ChatGPT’s text field. Once the response is generated, I copy it, return to the initial conversation, and paste it (Command+V) before sending. This manual workflow, with copy-and-paste steps, allows me to manage interactions efficiently while quickly switching between my conversations and ChatGPT across both screens.