Prompt template
Run these steps in order.
01
Create a bookmarklet JavaScript code that inserts a green 'Submit File' button before the element with class '.flex.flex-col.w-full.py-2.flex-grow.md\:py-3.md\:pl-4'. Style the button with white text, 5px padding, no border, 5px border radius, and 5px margin. 02
Insert a progress element before the same target element. Style the progress container with width 99%, height 5px, and a grey background. Inside it, add a progress bar div with width 0%, height 100%, and blue background. 03
When the 'Submit File' button is clicked, create an input element of type 'file' that accepts files with extensions '.txt', '.js', '.py', '.html', '.css', '.json', and '.csv'. Trigger the file selector dialog. 04
After file selection, read the file as text asynchronously and split it into chunks of 15000 characters each. 05
For each chunk, submit it to the ChatGPT conversation by programmatically setting the conversation textarea's value to 'Part part of filename:' followed by the chunk text, then dispatch a 'keydown' event to simulate pressing Enter (keyCode 13). 06
After submitting each chunk, update the progress bar width proportionally to the number of chunks submitted. 07
Implement a readiness check loop that waits until ChatGPT is ready for new input by checking the visibility of the selector '.text-2xl > span:not(.invisible)' before submitting the next chunk. 08
Once all chunks are submitted, change the progress bar color to blue to indicate completion.