I know of this Article and how to export the entire set of photos, but I want to export selected photos not all since there are over 200k
I am unsure of how to edit the script provided and adjust the parameters so that the Attachment layer can have a selection type and an SQL expression so only the identified files are saved.
I have not sure, whether you tried or not. Before exporting the attachments, first, perform the query option (Using select by attribute) and select the layers, without deselecting the layer run the tool. Usually, geoprocessing tool by default export the data only selected features.