On Sunday, May 11, 2003, at 7:04 AM, John Delacour wrote:

Whatever you can do with DropScript you can do more conveniently with Perl in an AppleScript droplet that _does_ know where it is.

The assumption that your working directory is where your script lives is broken.


You script's path is argv[0]. The path to files dropped onto the droplet are full paths. That's information you can rely on. Checking CWD doesn't make sense unless you set it yourself.

Here's a very simple example of a droplet (save as *Application* from Script Editor) that will create a text file containing a list of the paths of all the files dropped on it as Unicode UTF-8 and open the file in TextEdit displaying the names in Unicode preceded by the posix path of the droplet itself.

The problem with that is that now you are writing AppleScript as well as Perl. That's a whole new set of dependancies, and another language to learn/deal with. The point is DropScript is that it's language-agnostic. You can drop a gzip *binary* on DropScript and get a droplet out.


Such a droplet has the added advantage that it can be saved as a stay-open application, so that regular tasks can be executed immediately without the boring delay while the applet launches.

If you double-click on a DropScript droplet, it stays running.


-wsv


Wilfredo Sánchez - [EMAIL PROTECTED] iTunes Music Store - Content Acquisition



Reply via email to