a little button help

Hi all,

what am i doing wrong here. if i put the code in to a text and run it will do what i want

but when i put the code in to the script in a momentary button i get a error.

check the file for what i mean.

I am trying to build a button to open the preferences pane so i dont have to code a entire user interface for every little detail
par window mess up.toe (5.38 KB)

i figured it out,

But can someone please explain to me why in the example above it does not work?

Ah, tricky one here.

The error messages that Touch gives you are usually very helpful for debugging. In this case, when I click the ‘Momentary’ button, the Panel Execute DAT throws an error. If I middle mouse click on the OP, the info box says ‘Error: Unknown command: op’. op() is the Python function TouchDesigner uses to select OPs, and the code you wrote is correct Python code — the problem is that the OP was set to use T-script (TouchDesigner’s other scripting language) instead of Python.

If you click the ‘T’ icon in the upper right of the parameter box, the icon will switch to the Python logo and your network will run just fine.

Hope that helps,
Nic

Im still a little new with TD and have taken on a huge task in learning and building.
I missed that one little check box. everyday i am learning the power of the software

Hehe stick with it, this is what we have each other for!

Good point.
Next build will now include ‘tscript’ in tscript error messages:
example “Unknown tscript command:”