Setting Text Distances from a Script

Here is a simple script for setting the text distances for a text frame. In this particular version, we set all the distances the same, so only one value is needed for the value.Dialog.

More complex but more versatile
What if we didn't want all the distances to be the same? Look at this modification of the distance value.Dialog, and subsequent lines: We could use int(distance...), but using float allows for decimals. In case you haven't used the built-in split function in Python, this breaks a series of values or words into a list, eliminating the white space (which can be of variable length). So here we create the list distance[] from the 4 values.