The "example 3" should do the job. Have you ever used this script ?
It is not clear to me the how the PDBs are listed
"1DSB","*","30" , 1DSB is the PDB but what are * and the number. Mayb the number is the amino acid, but what if I whant all the residues. Moreover I do not understand why in the string
resis =...only part of the listed PDB are recalled.