Help, Transform & Replace Selection With ChatGPT not using selected text on certain webpages.

I've crafted a shortcut that combines the transform and replace function with GPT and floating WebView. When activated, it takes the selected text uses a ChatGPT prompt and displays a popup window offering a more detailed explanation of the highlighted text. However, not all websites are compatible with this shortcut I created.

I was wondering if it would be feasible to utilize the most recently copied text instead of the highlighted text. Additionally, I'm curious if there's a way to grant BTT permission to access that particular website.

Thank you, and apologies if any part of this message is unclear.

1 Like

Can you post your script?
You can probably use the get_clipboard_content function to use the clipboard content if no selected text has been copied.

Hi Andreas,
This is the script for the show "Floating Webview," but I think the problem is the transform/replace selection w/ ChatGPT can't access the selected text on that webpage. When I copy the text to a word or text editor first and then select it, it functions properly.
Thanks for all your help.


<!DOCTYPE html>
<html>
<head>
  <style>
    body {
      background: white;
      line-height: 2;
      font-family: "Times New Roman", Times, serif;
      font-size: 25px;
    }
  </style>
  <script>
    async function BTTInitialize() {
      let result = await callBTT('get_clipboard_content', {});
      window.document.getElementById("url").innerHTML = result;
      try {
        window.location = result;
      } catch (e) {
        console.log(e);
      }
    }

    async function BTTWindowWillBecomeVisible() {
      let result = await callBTT('get_clipboard_content', {});
      window.document.getElementById("url").innerHTML = result;
      try {
        window.location = result;
      } catch (e) {
        console.log(e);
      }
    }
  </script>
</head>
<body>
  <p id="url"></p>
</body>
</html>