Hi Sebastian - thanks for contacting Schrodinger, we're glad that you're giving our Python API a try.
Below is a script that contains some suggestions to get you started.
# To import schrodinger modules
from schrodinger import structure
from schrodinger.structutils import analyze
# To cycle through all the structures in a file
for struct in structure.StructureReader('3ligands.mae'):
print struct.atom_total
# To read the 2nd structure in a file
struct2 = structure.StructureReader('3ligands.mae', index=2).next()
# To merge two structures together (assuming you've already read in
# pocket_structure and protein_structure)
merged_structure = pocket_structure.merge(protein_structure, copy_props=True)
# Find all the atoms from the protein structure within 4 angstroms of the pocket
# structure atoms
pocket_atoms_asl = 'atom.n 1-%d' % pocket_structure.atom_total
asl = 'fillres ((within 4 %s) and not %s)' % (pocket_atoms_asl, pocket_atoms_asl)
nearby_residue_atoms = analyze.evaluate_asl(merged_structure, asl)
# Extract all the nearby atoms into a new structure
nearby_struct = merged_structure.extract(nearby_residue_atoms)
# Write out that structure to a new file
nearby_struct.write('new_file.mae')