If you mean the data you LOADed into QlikView then that you could STORE into a text file from the loadscript. If you mean a document variable then the easist thing would probable be to load the variable value into a QlikView table in the loadscript and use STORE to write that out to a text file.
VARIABLE_VALUES: Load '$(my_variable01)' as VARIABLE01 AutoGenerate(1); Store VARIABLE_VALUES into c:\mydir\VARIABLE_VALUES.txt (TXT);