Detect by code the width of the Arabic letter which is a type of path or compound path in Adobe Illustrator

In Adobe Illustrator I have many paths like arabic words in ottoman calligraphy layout, and the source of these paths is not a outlined text but a path.
So I need to detect by code (javascript, python, VBscript, …) the width of each arabic character in that path because I’m going to cut and separate each character in the path.
The cutting code depends on determining the location of the cutting in the path, which is equal to the starting location of the path, and add to it the width of the letter that I will cut now.
Note: I know in advance every letter in this path through previously preserved data. I only know what the letter is, and I do not know what is its size that changes from one word to another because it is a calligraphy layout and not a fixed font.
enter image description here
enter image description here
enter image description here
enter image description here