How to Get Selected UV Face and Assign it to an integer Value?



I’m trying to write a script to scale each individual face of a UV map, of which I have millions currently (experiments with point cloud to mesh conversion).

Essentially, I need a command to select the first UV face, run a command I’ve already written on that face, set an integer value to the face ID number, then select the next UV face using the integer value + 1 and then running the command I’ve written again until it’s reached the maximum number of faces, and then stop.

I’ve found how to select UV faces, but not how to set an int, nor how to increment it and check if it’s equal to the max faces of the object.

It would be extremely useful to know this, so thanks if you can help me!