text: user6445: I want to select multiple residues from different PDB files loaded on the same pymol session.
  select resi LIG
  get_area sele
  
  How do I loop the above command to enable the command below:
  select ligands,resn LIG
  
  
  user10049: from https://www.blopig.com/blog/2019/08/how-to-iterate-in-pymol/
  Example 1: Print the names of all the selected objects
  You’ve selected several objects in PyMOL, and you want to see their names. By default, a new selection object called “(sele)” is created. We can create a Python variable called seleobjs, say, and then loop over them:
  seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: print obj
  
  Example 2: Disable all the selected objects
  If you still have your selection, “(sele)”, you can disable them (effectively turn them off on the right-hand sidebar):
  seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: cmd.disable(obj)
  
  Example 3: Delete all the selected objects
  You’re done with the objects in your selection, “(sele)”: you might be able to delete them using “delete ”, but if you can’t write a wildcard that covers all the names of the objects, you can iterate over a selection and delete them:
  seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: cmd.delete(obj)
  
  from https://pymolwiki.org/index.php/Get_Area
  get_area calculates the surface area in square Angstroms of the selection given. Note that the accessibility is assessed in the context of the object(s) that the selection is part of. So, to get the surface areas of e.g. a component of a complex, you should make a new object containing a copy of just that component and calculate its area.
  please let us know if it worked
  
original_text: 6445: <p>I want to select multiple residues from different PDB files loaded on the same pymol session.</p>
  <pre><code>select resi LIG
  get_area sele
  </code></pre>
  <p>How do I loop the above command to enable the command below:</p>
  <pre><code>select ligands,resn LIG
  </code></pre>
   10049: <p>from <a href="https://www.blopig.com/blog/2019/08/how-to-iterate-in-pymol/" rel="nofollow noreferrer">https://www.blopig.com/blog/2019/08/how-to-iterate-in-pymol/</a></p>
  <p>Example 1: Print the names of all the selected objects</p>
  <p>You’ve selected several objects in PyMOL, and you want to see their names. By default, a new selection object called “(sele)” is created. We can create a Python variable called seleobjs, say, and then loop over them:</p>
  <pre><code>seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: print obj
  </code></pre>
  <p>Example 2: Disable all the selected objects</p>
  <p>If you still have your selection, “(sele)”, you can disable them (effectively turn them off on the right-hand sidebar):</p>
  <pre><code>seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: cmd.disable(obj)
  </code></pre>
  <p>Example 3: Delete all the selected objects</p>
  <p>You’re done with the objects in your selection, “(sele)”: you might be able to delete them using “delete ”, but if you can’t write a wildcard that covers all the names of the objects, you can iterate over a selection and delete them:</p>
  <pre><code>seleobjs = cmd.get_object_list('(sele)')
      for obj in seleobjs: cmd.delete(obj)
  </code></pre>
  <p>from <a href="https://pymolwiki.org/index.php/Get_Area" rel="nofollow noreferrer">https://pymolwiki.org/index.php/Get_Area</a></p>
  <p>get_area calculates the surface area in square Angstroms of the selection given. Note that the accessibility is assessed in the context of the object(s) that the selection is part of. So, to get the surface areas of e.g. a component of a complex, you should make a new object containing a copy of just that component and calculate its area.</p>
  <p>please let us know if it worked</p>
  