[Tutor] drag-and-drop argument passing

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 30 Jun 2002 02:32:29 -0700 (PDT)


On Thu, 27 Jun 2002, Pijus Virketis wrote:

> I have a script that takes an arbitrary number of paths to files as a
> command line argument, and manipulates the said files. Now, I would like
> to be able to execute the script and pass the arguments to it by
> drag-and-dropping the target files on the script icon in Windows. How
> should such inputs be handled? I have looked through the tutor and win32
> list archives on ASPN, but could not find an answer to this question.

Looks like someone else asked this on python-win32 a while back:

    http://mail.python.org/pipermail/python-win32/2002-April/000323.html

but no one responded!  You might want to check with Ian Bicking and see if
he found a good solution to this problem.


Hunting...

    http://www.planetquake.com/gg/tutorial/code/parms.html

Hmmm... that only mentions the first argument....


>From a totally unrelated message:

    http://srfi.schemers.org/srfi-22/mail-archive/msg00022.html

it sounds like the batch file argument '%*' might not work --- otherwise,
the Schemers would have used it.  *grin*


Microsoft's documentation on batch files:

http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/winxppro/proddocs/batch.asp

does mention %*, so this is really weird...



Let's try this.  Can you try modify the association that Alan recommends
from:

    D:\Python20\python.exe "%1" %*

to something like:

    D:\Python20\python.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"

Yes, I know this is ugly, but let's double check to see if '%*' works on
Windows.