Enterprise Scan script - assign document number to Batch field

Hi, please kindly support me - how to build a script that can assign each (PDFs) document number ( Doc. 1, Doc. 2, Doc 3, ….) into field "Batch" (Properties →Document→Batch).