Create a new visual part named FindDialog. In the Composition Editor add your parts as follows:
Switch to the Script Editor and add the following script:
findText: text inText: anMLE "Find and select the input text in the input MLE." | searchText cursor interval | searchText := anMLE object. cursor := (anMLE) cursorPosition. interval := searchText indexOf: text matchCase: true startingAt: cursor + 1. "or cursor + 2" (interval size = 0) ifFalse: [ anMLE cursorPosition: (interval first). anMLE selectTextFrom: ((interval first) - 1) to: (interval last). anMLE setFocus ].
This script will search the Multi-line Edit part for the first occurrence of the desired text after the Multi-line Edit part's current cursor position. If the text is found it will be selected in the Multi-line Edit part, which results in the cursor being positioned immediately after the desired text.
Switch back the the Composition Editor and make the following connections:
Your connections should look like the following:
After you finish making the connections, save your part.