subroutine
noun[C]
ITuk/ˈsʌbruːˌtiːn/usin alargecomputerprogram, a set ofinstructionsfor aparticularsmalltaskthat isavailableforrepeateduse:
In thetimeittakesyou toimportonepageandadjustthepictures, you could write a subroutine that does itautomatically.