That first line says that files with a ".py" extension are associated with the file type "python.file". The second line says that the "open" action when a file of type "python.file" is double-clicked is to run the command line shown. The "%1" in that string will be replaced by the name of the file that was double-clicked.
Note that, if you do not have a %1 in the string, there is no way for you to learn the file name.
···
On Tue, 8 Feb 2005 19:33:29 -0600, brian christensen <brianzz@earthlink.net> wrote:
I have been able to tell Windows and the Mac to open the application when its data file is double clicked, but what do you have to do in the application to recognized that it is being started by double clicking a data file? Where do you find the name(s) of the file(s) that were double clicked? Is there a wxWidgets function for that? Or do you use Python?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
>I have been able to tell Windows and the Mac to open the application
>when its data file is double clicked, but what do you have to do in the
>application to recognized that it is being started by double clicking a
>data file? Where do you find the name(s) of the file(s) that were
>double clicked? Is there a wxWidgets function for that? Or do you use
>Python?
It's in sys.argv. Here's the basic scheme.
C:\Dev\usbio>assoc .py
.py=Python.File
Does that command create an association or merely show you an
existing one?
That first line says that files with a ".py" extension are associated
with the file type "python.file". The second line says that the "open"
action when a file of type "python.file" is double-clicked is to run the
command line shown. The "%1" in that string will be replaced by the
name of the file that was double-clicked.
But that doesn't really do what he OP asked. Let's say he
wants to run "myWxProgram.py" for all files with a suffix of
".foo". He'd have to do something like