I have a table with a text containing cell.
Everytime I feed something to it, I’d like n-scripts to be triggered.
I could mantain a parallel constant chop with a dummy channel to do that, but I’m wondering if there’s a cleaner way.
tx
d
I have a table with a text containing cell.
Everytime I feed something to it, I’d like n-scripts to be triggered.
I could mantain a parallel constant chop with a dummy channel to do that, but I’m wondering if there’s a cleaner way.
tx
d
If the value is numeric you can use DAT To CHOP, then use Logic CHOP or Text DAT to trigger on changes.
If the value is a string you can hold the ‘old’ value in a DAT, then use a Constant CHOP with a strcmp expression to compare the old string with the current string in the table. When it changes the constant will change values. Use this to trigger your script. Along with whatever else you want the script to do, you should now set the value in the DAT that holds the ‘old’ value to whatever the new value is.
Hey Dani,
ok - I came up with a solution involving only dats. Maybe this is something you can use:
The basic logic is this: feed the table DAT into a eval DAT and have as the second input to the eval a table DAT with following contents:
execute("run myscript")
set the eval DATs “output” parameter to “Expression” and now the script is run every time the input table cooks.
To prevent it from running as many times as you have cells, use a merge DAT after the input table with the “how” parameter set to “Concatenate Cells”.
One thing is that this runs every time the table cooks and not only when it changed. So it will run at least once when you open the file.
I added a tox which uses this logic to add a row to a table every time the input table changes.
hope that helps
markus
runoncellchange.tox (910 Bytes)
or use an info CHOP and monitor the “last cook time” channel in a text DAT (on value change)