A selection cannot be made directly on a feature class or shapefile. It must be made on a feature layer. The ToC contains layers created when data is added to the map document, that is why you can do a selection on them.
Your script will need to include MakeFeatureLayer_management to perform the way you want. You can include your selection in the ...
Best guess: the filename is only the name, no extension.
You could probably do a quick addition in the code if you know all the files are JPEG.
Change the 2nd to last line to:
output = os.path.join(fileLocation, filename +".jpg")
This should get your JPEG extension back. Obviously this solution could be a problem if you have different file types ...
Despite what the documentation suggests (and how Python objects normally work in 99.9% of cases) you can't use keyword arguments when creating geometry objects. Using positional arguments only should solve the problem
The below code should achieve what you're trying to do. However as with all things programming there are many ways to go about doing this. Circling back to your original post, it looks like you are missing the colon ":" in your output file path. You put 'D\combined_data' instead of 'D:\combined_data' If that was an error in your original ...
You were almost there! Firstly ensure your parameters are their correct data type as shown below:
The correct code in the validation function updateParameters would be:
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter