Auto-populate static page field

Hi! How can I automatically populate the “uid” field in a static page using the RainLab Static Pages plugin before the page is saved, but only if the field is empty? The field is located inside a repeater.

For regular models, I would use the beforeSave method, but since static pages are file-based rather than database models, what is the correct way to achieve this behavior?