From: Diego Gomes (diego.enry_at_gmail.com)
Date: Wed Jun 26 2024 - 16:57:58 CDT

Hi Ryan,
if you can afford the wait, I can help you next monday.

In the meantime, take a look at the script below.
I wrote it here on Gmail, so don't trust it blindly.

Friendly,
Diego.

# Create an empty list
set model_list [list]

# Populate the list with the model file names
# excluding the extension
foreach f [glob model*] {
  lappend model_list [file rootname $f]
}

# Loop
# 1 - Load model
# 2 - Select residues
# 3 - Save to new pdb
# 4 - Cleanup workspace.
foreach model ${model_list} {

  #####################
  # Perform actions
  #####################

  # load model
  mol new ${model}.pdb

  # select residues
  set sel [atomselect top "resid 190-350"]

  # save new pdb with selected residues
  writepdb ${model}.190-350.pdb

  #####################
  # Clean up workspace
  #####################
  # Delete atomselection
  $sel delete

  # Delete PDB from VMD
  mol delete all
}