Copy link to clipboard
Copied
Hello
i have a large multi line Text Field that contain multiple visits with a certain Date configurations
something like this (Sunday 06/01/2019):
I was able to collect them through RegEx and put them in a popUpMenu through this code:
function ShowVisits() {
var keyword = /[(](\w{6,9})\s(\d{1,2})[/](\d{1,2})[/](\d{4})[)][:]/g
var str = this.getField("HistoryT").value;
var match = str.match(keyword);
var begining = ["Visits"];
var aGhazali = match.unshift(begining)
var cRtn = app.popUpMenu(match)
}
What I would like to do now is to modify the function to search in the content of the Text Field and do something like setting focus or scroll down to where the match is.
I have tried to search using the built in Find but it only finds the match if it is available in the screen, but if its need to be scrolled to find will show no matching is found
thanks
That is not possible.
Copy link to clipboard
Copied
That is not possible.
Copy link to clipboard
Copied
There is no straight forward way to do this. The only way to select text within a text field is through the Keystroke event. And I do now know if this would result in the text field scrolling to a specific position. But you could try. Unfortunately there is only way to get an uncommitted keystroke event, and that is for the user to click into the text field. So you'd have to first select from the dropdown, and then click into the text field.
Look up the event.selStart and event.selEnd properties of the Event object.