Question from beginner (How to automate translation?)

I have to translate 300 slacks, and the translation of x-direction, y-direction have different values for each stack. And the translation value is retrieved from ROI measure of x, y. And now, I have finished the ROI measurement. However, I have had so many difficulties how to automate applying the translation. Please help!