Hi. I want a shortcut that copies marked text and feeds it back into ChatGPT and clicks enter.
Hitting tab x times is one way. However, the number of tabs are different each time.
Any ideas how to jump to the text input field shown below?
Simplify dialog with ChatGPT
- Krutstugan
- Posts: 22
- Joined: 26 May 2021, 09:56
Re: Simplify dialog with ChatGPT
python + selenium would be better,
but in the land of ahk, there is a chrome.ahk library.
but in the land of ahk, there is a chrome.ahk library.
Re: Simplify dialog with ChatGPT
For reference, besides Chrome.ahk, it is also possible to use AHK with Selenium (although not overly popular, I guess). Or you could use instead Rufaydium. Or possibly some kind of javascript injection (like eg teadrinker has shown in the past).
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: Simplify dialog with ChatGPT
No one's mentioning the amazing UIA_Interface.ahk? It's much simpler than all above.
Re: Simplify dialog with ChatGPT
Yeah, might be sufficient for this use case. I still haven't used UIA yet, but afaik the specialized tools can do more advanced browser automation (headless mode, automating inactive tabs, ...).
If that's needed here, or if this is all about working on an active tab, we don't really know yet. If it's about the active tab, teadrinker's technique (look for RunJsFromChromeAddressBar() or similar) might actually be the easiest solution. I think it uses Acc (accessibility) functions, so it's loosely related to UIA. Not sure, if a v2 version has been posted yet.
If that's needed here, or if this is all about working on an active tab, we don't really know yet. If it's about the active tab, teadrinker's technique (look for RunJsFromChromeAddressBar() or similar) might actually be the easiest solution. I think it uses Acc (accessibility) functions, so it's loosely related to UIA. Not sure, if a v2 version has been posted yet.
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: Simplify dialog with ChatGPT
To be honest, it's sufficient for most of the use cases. Average users just need to automate the browser like they automate the desktop.
I've used RunJsFromChromeAddressBar quite intensively in the past and loved it. Unfortunately it needs updating recently because Chromium browsers no longer expose the address bar to Acc and we now have to use UIAutomation to control the address bar anyway. Also writing the Javascript to evaluate is more complicated than writing UIA commands. Not to mention Descolada's UIAViewer provides a macro creator which generates those commands for you. UIA should be the first choice for new users.
I've used RunJsFromChromeAddressBar quite intensively in the past and loved it. Unfortunately it needs updating recently because Chromium browsers no longer expose the address bar to Acc and we now have to use UIAutomation to control the address bar anyway. Also writing the Javascript to evaluate is more complicated than writing UIA commands. Not to mention Descolada's UIAViewer provides a macro creator which generates those commands for you. UIA should be the first choice for new users.
Re: Simplify dialog with ChatGPT
Thank you, good to know
Re: Simplify dialog with ChatGPT
ahk is NOT popular, and a small niche in it is EVEN more less popular. (not unpopular)
Re: Simplify dialog with ChatGPT
Did you figure it out?
Re: Simplify dialog with ChatGPT
just use chrome extinction that put URL in chrome title, used for ages and never break, also good for vanilla Keepasswilliam_ahk wrote: ↑04 Mar 2024, 01:27To be honest, it's sufficient for most of the use cases. Average users just need to automate the browser like they automate the desktop.
I've used RunJsFromChromeAddressBar quite intensively in the past and loved it. Unfortunately it needs updating recently because Chromium browsers no longer expose the address bar to Acc and we now have to use UIAutomation to control the address bar anyway. Also writing the Javascript to evaluate is more complicated than writing UIA commands. Not to mention Descolada's UIAViewer provides a macro creator which generates those commands for you. UIA should be the first choice for new users.
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: Simplify dialog with ChatGPT
Using UIA, it's really simple.
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Include UIA.ahk
F1::
{
W := WinExist("ahk_class Chrome_WidgetWin_1")
W := UIA.ElementFromHandle(W)
PromptTextArea := W.WaitElement({AutomationId: "prompt-textarea"})
PromptTextArea.Invoke()
;PromptTextArea.Value := "Guten tag"
}
What do you mean?
Re: Simplify dialog with ChatGPT
@william_ahk
https://chromewebstore.google.com/detail/add-url-to-window-title/ndiaggkadcioihmhghipjmgfeamgjeoi
https://chromewebstore.google.com/detail/add-url-to-window-title/ndiaggkadcioihmhghipjmgfeamgjeoi
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: Simplify dialog with ChatGPT
Oh this is pretty cool, could be nifty in some cases.xMaxrayx wrote: ↑30 Jul 2024, 10:52https://chromewebstore.google.com/detail/add-url-to-window-title/ndiaggkadcioihmhghipjmgfeamgjeoi
Re: Simplify dialog with ChatGPT
You can also use
This function uses a URL where anything following chat?q= will be pasted into the text chat.
You can highlight anything activate the function and it will be pasted into the text chat as a new conversation.
Otherwise I think UIAutomation would be the best bet if you want to use it with already open GPT chats.
Code: Select all
OpenChatGPTWithQuery() {
Run("https://chat.openai.com/chat?q=" . A_Clipboard )
}
You can highlight anything activate the function and it will be pasted into the text chat as a new conversation.
Otherwise I think UIAutomation would be the best bet if you want to use it with already open GPT chats.
Last edited by Ragnar on 30 Jul 2024, 12:37, edited 1 time in total.
Reason: code tags
Reason: code tags
Who is online
Users browsing this forum: Bing [Bot], DavidP, FanaticGuru, mikeyww, TomDonovan and 108 guests