Here's the script that I use. It does read information from the parent table to get the Object ID along with the attachment's ID to use in renaming the photo.
import arcpy, os
masterFC = r'C:\Path\to\file.gdb\feature'
masterFlds = [ 'GlobalID', 'OBJECTID' ]
relatedTbl = r'C:\Path\to\file.gdb\feature__ATTACH'
relatedFlds = ['REL_GLOBALID', 'ATTACHMENTID', 'DATA', 'CONTENT_TYPE']
saveLocation = r'C:\Path\to\save\attachments'
masterDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(masterFC, masterFlds)}
with arcpy.da.SearchCursor(relatedTbl, relatedFlds) as cursor:
for item in cursor:
if item[3] == 'image/jpeg':
f1 = masterDict[item[0]][0]
f2 = item[1]
fileName = "ATT_{}_{}.jpg".format(f1, f2)
saveName = os.path.join(saveLocation, fileName)
f = open(saveName, 'wb').write(item[2].tobytes())
del cursor
del item
If there is a short text item in the parent feature that would also be good to have (an id code field, or tree species, for example), the code could be easily modified to include that information in the file name.
masterFlds = [ 'GlobalID', 'OBJECTID', 'TreeSpecies' ]
f2 = item[1]
f3 = masterDict[item[0]][1]
fileName = "ATT_{}_{}_{}.jpg".format(f1, f2, f3)
While this is not a "script tool", it can be made into one. Hope this helps.