From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Nov 03 2009 - 09:11:05 CST

Nuno,
  In the script that you have VMD execute with -e, you would need
to have it do whatever "package require" command is needed, followed
by your "::Script::File $file" as the last command. You would then
also be able to use the command line arguments to specify the file that's
being loaded, etc. The actual command that you're executing must be in
the script that you run, it can't be a command line argument.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Nov 03, 2009 at 01:41:11PM +0000, Nuno Sousa Cerqueira wrote:
> Thanks for the reply Nicolas.
>
> But let me explain a little better what is my problem.
>
> I create a plug-in for VMD. The GUI part is used to setup the input
> file and analyse the results. Therefore everything is encapsulated
> into a namespace (for example ::Scirpt)).
> The problem is that the proc that runs the application can take a long
> time.
> I just create the proc ::Script::File $file to allow allow the user to
> run it under the shell.
> this proc just have as arguments the variable $file
>
>
> Is it possible to run this proc under the shell using VMD ?
>
> Regards,
> Nuno
>
>
> On Nov 3, 2009, at 11:07 AM, Nicolas Sapay wrote:
>
> >Hello Nuno,
> >
> >The -args option is employed to pass arguments to a script via the
> >argv variable. This means that $argv = {"::Script::File"}. At that
> >point, "::Script::File" is just a value stored in a variable, not a
> >TCL command. If you want to execute a TCL script, you can use:
> >
> > vmd -dispdev text -e file.tcl
> > vmd -dispdev text -eofexit < file.tcl
> >
> >
> >If your script requires user-defined arguments, you can use:
> >
> > vmd -dispdev text -e file.tcl -args -option1 value1 -option2
> >value2 ...
> > vmd -dispdev text-eofexit < file.tcl -args -option1 value1 -option2
> > value2 ...
> >
> >Regards,
> >Nicolas
> >
> >Nuno Sousa Cerqueira a écrit :
> >>Hello,
> >>
> >>I have a analysis script that I use very often with VMD. The
> >>script is under a namespace and does several calculations that
> >>freezes VMD interface (and takes a long time). Therefore I am
> >>trying to run it using the VMD shell.
> >>
> >>To run the script I have something like:
> >>
> >>::Script::Shell File
> >>
> >>
> >>where File is a file that is required for the calculation.
> >>
> >>
> >>I am trying to use the VMD shell option using the following command
> >>
> >>
> >>vmd -dispdev text -args "::Script::Shell File"
> >>
> >>but it does not give me the desired results. The VMD runs, but the
> >>proc ::Script::Shell File does not start.
> >>If I open VMD (vmd -dispdev text) and I write ::Script::Shell
> >>File, it works fine.
> >>
> >>Does anyone has a workaround for this issue.
> >>
> >>
> >>Regards, Nuno
> >>
> ><nicolas_sapay.vcf>
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078