PennController for IBEX › Forums › Support › Convert Var/Text to String for get-method › Reply To: Convert Var/Text to String for get-method
May 9, 2023 at 5:06 am
#10526
![](https://www.pcibex.net/wp-content/uploads/2018/10/IMG_8365-e1540835663655-150x150.jpg)
Keymaster
Hello Christin,
You cannot use a reference to a PennController element inside a getX
command, because the execution of (plain) JavaScript is immediate, but that of PennController commands is delayed
What you can do is use a Function element in which you manipulate the PennController elements by accessing their methods and attributes:
getButton("B1") .callback( newFunction( ()=>{ try { getCanvas( getVar("canvasnr")._element.value ).visible()._runPromises(); } catch (e) { } }).call() )
Jeremy