If you put a button in the portal row or set up a field or group of fields as a button, the mouse click that triggers the button also selects that portal row and makes it the active portal row.
Any references to the fields in the portal made by the script will then refer to the selected portal row's record as long as now script action takes the focus away from this active portal row.
Thus, many such scripts start with a series of set variable steps that copy selected fields from this portal row record (any field in this related record--even if not placed on this portal's row), that are needed to different variables. You can also save the current portal row number in a variable if you need to keep track of it using get ( activePortalRownumber ).
You can capture the value of any field with script trigger OnObjectEnter attached to field.
Script step with simple Set Variable [ $value ; Get ( ActiveFieldContents ) ] or any variation. Script can use Get ( ScriptParameter ) also, with this function attached as parameter.
Note you cannot grab field value using OnObjectEnter when clicking or popping pop-up menu, radio button or checkbox although tabbing to these objects will properly select original value.
I solved the problem as suggested by Laretta. In edit mode I set a script trigger in the TargetField (it will always be the same field). The script is as follows:
if position(TargetField; "special text" : 1 ; 1) > 0
It works perfectly, Clicking on any other field in the row with special text or in any row without the special text, does nothing.