Hi
I’m trying to add some JavaScript to copy some OpenAI generated text and an image to the clipboard in a free tool we’ve created to help people create social media content (at https://aitools.aiaas.team/ if you’re interested)
I’m using the Toolkit plugin with a Run JavaScript action when the icon is clicked but I get this error
The code is very simple (below) with the data being written to the clipboard coming from a dynamic custom state
What am I doing wrong?!?
I’m sure it’s just me being dumb…any help is really appreciated
GH5T
April 5, 2024, 9:25am
2
What does the response look like?
It’s the text from ChatGPT …to see it please type something into the box and hit “Create Draft” at https://aitools.aiaas.team/
GH5T
April 5, 2024, 9:28am
4
Okay it may be simpler than you thought. Remove the quotes from your script.
GH5T
April 5, 2024, 9:32am
6
Have you used :formatted as JSON safe?
Use that method without quotes.
1 Like
Thanks for looking at it…I’ll try that
hergin
April 5, 2024, 10:02am
8
If you are copying something to clipboard, try this solution as well. It can copy more complex html into the clipboard.
You can do it. Totally non Bubble way though. Pure HTML and JS.
It looks like you are using HTML element to format the signature, which is good. You can add some javascript magic to copy this if you assign an ID to the main table in the HTML element. Then, you can call the following function on a button click on the page (HTML again) and copy the table. See the demo below:
[chrome_USE982oz5B]
And here is the function I added:
[image]
And this is the ID of the table and a button that calls t…
GH5T
April 5, 2024, 10:05am
9
Interesting. That works the same way as other copy to clipboard plugins or differently?
hergin
April 5, 2024, 10:10am
10
I don’t know the plugins in the area. I am assuming it should work the same. There are not many different ways to copy to clipboard I guess
Thanks I’ll look at that as well
Just to let you know that your suggestion worked thanks @GH5T
This works fine…
1 Like
system
Closed
June 14, 2024, 9:21am
13
This topic was automatically closed after 70 days. New replies are no longer allowed.