[Chimera-users] call file-> open gui popup from script ?
klexa at umich.edu
Thu Apr 17 11:24:34 PDT 2014
Terrific! Thanks Eric and Conrad.
On April 17, 2014 at 10:41:21 AM, Eric Pettersen (pett at cgl.ucsf.edu) wrote:
If the file is something that your script needs to read itself (a list of residue IDs or something) then instead of the "open" command you would do this to get the file path:
from OpenSave import OpenModal
from chimera.tkgui import app
pathsAndTypes = OpenModal(title="Input for script").run(app)
'pathsAndTypes' is a list of 2-tuples. The 2-tuples are the path and file type. So assuming you only want one file, you would get the file path with:
path = pathsAndTypes
UCSF Computer Graphics Lab
On Apr 17, 2014, at 8:54 AM, Conrad Huang <conrad at cgl.ucsf.edu> wrote:
> You can use the "open" command with no arguments to pop up the open dialog. Chimera should wait until you select a file (or cancel) before continuing to the next command (either on the same line or the next line in a script).
> On 4/16/2014 5:58 PM, Katrina Lexa wrote:
>> Hello All,
>> I’m wondering if there is a way to call the file->open popup within
>> chimera when running a python script? I know that it’s possible to run
>> the script on the command line and read the desired arguments in that
>> way, and obviously the files I want could be coded in and then changed
>> every time I want to look at something new, but I’m not seeing an
>> obvious option from the mailing list or in the runCommand list for
>> writing in a mid-script call for the user to select a file. Is such a
>> thing possible?
>> Thanks for your help,
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-users