I want to select all objects in a collection (collection names are known).
pseudo:
selectedObjs1 = allObjectsInCollectionName; <--- How?
for all objects in selectedObjs1:
process...
Thanks.
If you want to process every object in a collection, you would have to iterate through Collection.all_objects:
collection = bpy.data.collections["collection_name"]
for obj in collection.all_objects:
print(obj.name)
Further reading: How to list all collections and their objects?