RFE: "Find in DATS"

Hey there. I thought of a suggestion while using tscripts / DATS which might make them easier to use.

I’ve been making a touch designer app which is pretty DAT/tscript heavy. I find myself consistently wishing there was a ‘Find in DATS’ utility under Edit while programming tscripts (especially after the number of DATs containing scripts surpassed 20). Find utilities are used quite often in any programming language.

Id imagine the utility would center on the node, make it a reasonable scale on the screen for reading, toggle the viewer flag and highlight the searched text. ‘Find next’ would restore the viewer flag, un-highlight and switch to the next occurrence.

Thanks.

You can easily create your own. Check the find command, I think the syntax is
find -d “searchstring” /*

this will give you a list of all nodes with “searchstring” in their data. Store that info in a table, and the iterate over the list and set a pane to select that node, enable the tileviewer, … (there is also a flag for the find command which will run a script for each found node, so check that out as well)

You might also want to check the F10 command when the mouse is over a tuik gadget. It should call a script from which you can probably steel the “set pane to a certain node” code. Not 100% sure, it was mentioned in the wiki a while back. Markus probably knows where to find that script and if it’s applicable for your task.

The only thing that probably wont work is highlighting the found string in the text DAT, but it’s a start.

EDIT: I’m not in front of touch so I might be wrong, but there is a find operator dialog? somewhere, maybe this also has support for searching an operators data and will automatically zoom to that node. Worth atry

Wow. I can’t believe I never knew about that command until today (I’m a tscript newbie). This will make tracking down code much easier. I checked the operator browser, it doesn’t seem to have any functionality which allows you to search for data.

That might be a better suggestion for this RFE then, a new main tab next to “Pallete, Operator, Channel” called “Data” in the operator browser, which lists all the operators containing a substring of data (basically an interface for the find command) and lets you right click → Viewer much like the Operator tab.

Thanks!

it’s CTRL-f in a network editor, but it doesn’t search a node’s data, just the name. So you’ll have to create your own component to handle that.

Forget the F10 stuff I said before, there’s nothing interesting in the script. I somehow recall a release note showing how to zoom a pane to a specific node. hmmm, must be mistaken

Anyway, what you can do is, after you got the nodelist from the find command, store in a table and have a pair of next/prev buttons stepping thru the list. On each click, you can use the the textport command, to load your new DAT into a textport (can be in a pane or floating) and remove the old one.

This way you can also use the textport’s search field to find/highlight the text

If you press F2 over any displayed panel , It’ll change/zoom the network pane to the COMP for that panel. You can press it anywhere, even over the OP Create Dialog.

in case you’re wondering what F2 script F2 calls, look at
/local/macros/F2