(self, _)
Main function
Main function
Main function
def onFieldToTags(self, _):
    """Main function"""
    nids = self.selectedNotes()
    count = len(nids)
    if not nids:
        tooltip("Please select some cards.")
        return
    fields = sorted(find.fieldNames(self.col, downcase=False))
    if not fields:
        tooltip("No fields found."
            "Something might be wrong with your collection")
        return
    
    field = getField(self, fields)

    if not field:
        return

    q = ("Are you sure you want to convert the <b>'{}'</b> field "
        "to tags in <b>{}</b> selected notes?".format(field, count))
    ret = askUser(q, parent=self, title="Please confirm your choice")
    if not ret:
        return

    self.mw.checkpoint("Find and Replace")
    self.mw.progress.start()
    self.model.beginReset()

    edited = self.fieldToTags(nids, field)
    
    self.model.endReset()
    self.mw.progress.finish()
    tooltip("{} out of {} notes updated.".format(edited, count))
def onFieldToTags ( self , _ ) : nids = self . selectedNotes ( ) count = len ( nids ) if not nids : tooltip ( "Please select some cards." ) return fields = sorted ( find . fieldNames ( self . col , downcase = False ) ) if not fields : tooltip ( "No fields found." "Something might be wrong with your collection" ) return field = getField ( self , fields ) if not field : return q = ( "Are you sure you want to convert the <b>'{}'</b> field " "to tags in <b>{}</b> selected notes?" . format ( field , count ) ) ret = askUser ( q , parent = self , title = "Please confirm your choice" ) if not ret : return self . mw . checkpoint ( "Find and Replace" ) self . mw . progress . start ( ) self . model . beginReset ( ) edited = self . fieldToTags ( nids , field ) self . model . endReset ( ) self . mw . progress . finish ( ) tooltip ( "{} out of {} notes updated." . format ( edited , count ) )