I want to get a number from the filepath of the current file in Sikuli - Jython
I have a python example of what i'm trying to achive.
In the example the path is: C:\PycharmProjects\TestingPython\TestScripts\TestScript_3.sikuli\TestScript.py
import os
PointerLeft = "Script_"
PointerRight = ".sikuli"
FilePath = os.path.dirname(os.path.abspath(__file__))
NumberIWant = FilePath[FilePath.index(PointerLeft) + len(PointerLeft):FilePath.index(PointerRight)]
print(NumberIWant)
So what i want to get is the number 3. In python the example above works, but I cant use the __file__
ref in Sikulix. Nor does the split of the string work, so even if I get the string of the path, I still have to get the number.
Any help and/or ideas is greatly appreciated