Here is the source code for a script tool (but you can also run it as is without creating a custom script tool). I've added some comments to make it easier for you to follow. The basic idea is that you can specify the field which you would like to use to name each output attachment.
If you would like to name your output attachment using multiple fields, you can easily modify the source code to include multiple fields and then modify how the lookup dictionary feature_names = {row[0]: row[1] for row in lookup}
will be constructed.
import arcpy
import os
##define input parameters for the tool
#input attachments table
in_table = arcpy.GetParameterAsText(0)
#output folder to save files in
file_location = arcpy.GetParameterAsText(1)
#field to be used for naming attachments
name_field = arcpy.GetParameterAsText(2)
#getting the feature class name from the attachments table through the relationship class
#simple way to do this - however might break should the table be named in another way in
#upcoming releases - is to use `inTable.split('__')[0]`
in_table_desc = arcpy.Describe(in_table)
relclass = os.path.join(in_table_desc.path, in_table_desc.relationshipClassNames[0])
rel_class_desc = arcpy.Describe(relclass)
fc = os.path.join(rel_class_desc.path, rel_class_desc.originClassNames[0])
foreign_key_field = [i[0] for i in rel_class_desc.originClassKeys if i[1] == 'OriginForeign'][0]
##creating a dict with values to be used for naming output attachments files
globalid_field = arcpy.Describe(in_table).globalIDFieldName
with arcpy.da.SearchCursor(fc, [globalid_field, name_field]) as lookup:
feature_names = {row[0]: row[1] for row in lookup}
##iterating attachments and saving them on disk
with arcpy.da.SearchCursor(in_table, [foreign_key_field, 'DATA', 'Content_Type']) as cursor:
for item in cursor:
featureid = item[0]
attachment = item[1]
featurename = feature_names[featureid]
if not isinstance(featurename, unicode):
featurename = str(featurename)
filename = featurename + '.' + item[2].split('/')[1]
#constructing the output file path
filepath = os.path.join(file_location,filename)
with open(filepath, 'wb') as f:
f.write(attachment.tobytes())