Iï¿½m writing a simple script (or studio application) to act as a helper for a web application. Basically, I want to drag a URL directly from a web-browser onto a droplet.
I canï¿½t figure out how to get the droplet (or studio application) to recognize a URL pulled from a browser. I know you can drag the URL to the desktop and then drop the .url file onto a droplet, but my goal is to eliminate a step and not create extra files. This is ultimately an end-user tool and I want it as clean as possible.
I know you can drag a URL from IE into an open Text-Edit or MS Word document and it will automatically change the URL to text. I was hoping to mimic this functionality with AppleScript or AppleScript Studio. If someone knows how to do this (or if it is impossible), I would greatly appreciate the help.
I won’t swear to it but I seem to recall a discussion on this topic and it was determined/concluded that it is not possible. For the sake of your project, I hope I’m wrong.
Here’s a quick AppleScript Studio project I just whipped up that accepts a drag & drop URL:
To use it, you can launch the compiled app that is in the build folder. A small window will open with a single text field in it. You can drag & drop a URL from Safari (or any browser) and it will act on that URL. For some reason the first drop doesn’t seem to register anything but subsequent drops are fine. This is just an example project and it will simply display a dialog with the URL. You could modify the (included) source code to do something more useful with the URL.
Thank you for your time. This is perfect!
The discussion must have been related to doing this with an AppleScript droplet. I’m glad that I was wrong.