From: Nuno Sousa Cerqueira (nscerque_at_fc.up.pt)
Date: Tue Nov 03 2009 - 07:41:11 CST

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>