Tried doing in in hooks script such as below:
def zap_started(zap, target):
os.environ['TARGET_URL'] = target
def zap_started(zap, target):
print("Env property: {} = {})".format('TARGET_URL', os.environ.get('TARGET_URL','[EMPTY]')))
So basically using Python way to set OS variables, saving it in one hook, and trying to read in in other for confirmation.
I see there is org.zaproxy.zap.extension.script.ScriptVars in JavaDocs which can allow it but can it be used in pure Python scripts as in hooks?