@alexandrsemenov if @JonB 's solution is too complex for your request, please try

import ui tf = ui.TextField() tf.frame = (0,0,300,40) tf.name = 'Window of TextField' tf.placeholder = 'type here, then press X' tf.begin_editing() tf.present('sheet') tf.wait_modal() var = tf.text # put the TextField text in a variable def next_function(v): print(v) next_function(var) # pass the variable to the next function