Automatic Invoice Updating with Criterias

Hello Everyone,

I am looking to Automatically update invoices wither certain criterias, any idea on how to do this? I am looking to have the invoices with certain Customer Divisions that have a tracking number upated automatically each day. All our invoices are individual batches. I am guessing I need to use scripts but have no clue where to begin writing one as I have never done it.