Hi Elaine.

Thank you for your kind reply.
I will read the website you provided and look for a solution. Based on your description, intuitively I think foreachfile might solve my problem.
Thanks again sincerely.
BTW, maybe It is time for me to grab some Python things. :D

Yours
Ran
From: Elaine Meng <meng@cgl.ucsf.edu>
Date: 2023-09-29 09:27:07
To:  "洪冉" <hongran@ahpu.edu.cn>
Cc:  chimerax-users@cgl.ucsf.edu
Subject: Re: [chimerax-users] wildcard used within SAVE command>Hi Ran,
>ChimeraX wouldn't automatically know the name of the molecule from the structure, but maybe you mean it is the model name as shown in the Model Panel?
>
>Model names can be changed with the command "rename"
><https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.html>
>
> ... but then to automatically put the model name in the output file name, you would need to use a python script.  I don't know python so somebody else would have to advise on that.
>
>If you already have the structure name as an input file name, e.g. in ChimeraX you want to open benzene.pdb and later save benzene.png, it could be done using a ChimeraX command file and the "forEachFile" option.  You would create the command file in a text-editor.  This is just a plain text file containing the ChimeraX commands you want to run on each structure, named something.cxc -- and then use the "open" command to open this cxc file with the "forEachFile" option to run it on multiple PDB files and create multiple PNG files with the same base name as the input files.  See details in the following links.  ChimeraX command files:
><https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html#cxc-files>
>
>...and the "open" command "forEachFile" option:
><https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile>
>
>However, that would not let you interactively position the structures; instead everything from opening the files to saving the outputs would be done by the commands in your cxc file.
>
>I hope this helps,
>Elaine
>-----
>Elaine C. Meng, Ph.D.                       
>UCSF Chimera(X) team
>Department of Pharmaceutical Chemistry
>University of California, San Francisco
>
>> On Sep 28, 2023, at 5:12 PM, 洪冉 via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> 
>> Hi all,
>> I have been trying to produce some high-resolution pictures recently using ChimeraX.
>> And "save C:/xxxx/xxxx/test.png" was used to produce the pic, then I had to change the context "test" into each structure name manually.
>> e.g.
>> save C:/xxxx/xxxx/benzene.png
>> or 
>> save C:/xxxx/xxxx/methanol.png
>> Actually, the structure loaded into chimeras was with the right name.
>> Hence, I want to ask for help if is there a wildcard that could be used in the "save" command for saving the picture with the name of the structure.
>> 
>> e.g.
>> save C:/xxxx/xxxx/${nameofstruc}.png
>> Of course, it does not work.
>> I just want to give this as an example to suggest my opinions.
>> 
>> Thanks in advance.
>> 
>> Yours, 
>> 
>> Ran
>> 
>> _______________________________________________
>> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>