You can export the variables. That's the easy way. You can also load them from .qvw documents by using them as xml table file sources and extract the VariableDescription table. If you want to mark them as generated from script (y/n) then you'd have to run through the list of variables and check for each if they were created in the script. That could be next to impossible if you create variables dynamically with code instead of simple single SET/LET statements.