I am writing a script to set a global variable with the contents of a field using the OnObjectEnter script trigger as I need to capture the current value in that field before it is changed.

There are four fields on the layout to which I want to apply this trigger. It works fine when the fields are formatted as drop-down lists, but not when they formatted as drop-down menus. I understand that the script trigger behaves differently depending on whether it is applied to a drop-down list (the script will run first) and a drop-down menu (the script runs after a value is selected). I believe I need to pass the value in the field as a parameter, Get(ScriptParameter) but I am damned if I can figure out how.

The drop-down list script is:

Set Variable [$$Content; Value: GetField (“MyActualFieldName”)]

So far for the drop-down menu version I have:

Set Variable [$$Content; Value: Get (ScriptParameter)]

I attach that to the field with the Script Parameter as follows:

GetField(GetFieldName(Evaluate(Get(ActiveFieldName))))

I get a question mark returned as the data. Clearly not doing it right.

As mentioned I need to use this script on multiple fields so a single script for all would be good.

I believe I need to pass the value in the field as a parameter, Get(ScriptParameter) but I am damned if I can figure out how.

You can write the script parameter when choosing the script.

I put the field I want passed into the script parameter section. That will pass the fully qualified name into the script. Then I believe you can do GetField ($Content).

you can simply skip a few steps by putting

GetField (GetFieldName ( YOURTABLE::YourField) ) in the script parameter section. If possible, I'd always commit the record so that the new data is put in the field when the trigger is run. The function Get(ActiveFieldContents) wouldn't work in this case because the record has been committed.

As mentioned I need to use this script on multiple fields so a single script for all would be good.

Just use this same method for every field you want and it will work every time. The parameter still needs to be unique to the field in your case.