4 ms·
Ask HN: Implementing Auto-Copy
I've been scratching my head and Googling the last couple of days looking for a way to implement auto-copy into a project. We've tried using the clipboard implementation which basically uses a small flash file to copy, only problem is that it breaks in Flash 10.
Need some help from the hackers, I'm all out of ideas.
EDIT: I wasn't that clear, sorry. Basically I have a url shortening script and I want someone to be able to shorten a url, be redirected to a page and have that short url they created auto-copied to their clipboard - so they can just close the window and paste the link easily.
- pclark 18y agoI like the idea of a popup box and making the cursor ideally select all the text.
- pclark 18y agooh and could you make your bookmarklet popup in a new window? never got why people didnt do that.
- hopeless 18y agohttp://url.ie http://url.ie (another url shortening service -- do we need yet more???!) does exactly what you want. I believe it's just javascript but you can check the page source for yourself
- pclark 18y agoquite, what is up with all these services? there most be two dozen now.
- mikeyur 18y agoWe know. I can name 5-10 services off the top of my head that do the same thing we're doing. This is more of a personal project, not a major site trying to compete with the likes of tr.im is.gd tinyurl etc. We are planning on releasing the code once we finish it up so anyone can host a url shortening service on their own site. Just another stupid weekend project :) Back to url.ie and their url copying - it uses the flash implementation meaning it breaks for anyone with Flash 10.
- kaens 18y agoAuto-Copy as in the firefox extension? Or what? I think you're going to need to be a bit more specific here.
- mikeyur 18y agoSorry about that, updated.
- ivank 18y agoYou would have to somehow get the user to click on the Flash object. I wouldn't rely on Flash for the user experience, though. What YouTube does is probably best (an input box that selects all on click). People are probably most familiar with that method. Even better would be to figure out a workflow where the user doesn't have to copy, or paste anything.
- mikeyur 18y agoWe actually have that right now, the box selects all when you click it: http://www.grabup.com/uploads/3fa8b2cde15df8314a8ce242451b039d.png?direct http://www.grabup.com/uploads/3fa8b2cde15df8314a8ce242451b03... Just thought it would be nice if there was an auto-copy function - so shortening with our bookmarklet and copying took just 1 click.