The way I have done this in the past is to create a new layout assigned to a new Table Occurrence of the same Base Table you are using, I will call these HoldingTO and HoldingLayout. The first thing you will do in your script is to store the current found set in this TO and then go back to your original layout and perform your actions, Because you are looking at the same data through a separate Table Occurrence the found set will not be affected.
The way to get the found set onto into another table occurrence is by using the Go to Relater Record script step, Getting related records from the Table Occurrence your found set in in, and showing results using the layout of the holding TO. The Option Dialog will be something like this.
Get related records from: ActionTO
Show records using layout: HoldingLayout (HoldingTO)
Result Options: Tick "Show only related records" "Match all records in current found set"
This will go to all the records in your original table on the new layout, you can then go back to the original layout, perform you script actions. When you have finished go to the new layout and perform another Go To Related Records, but the first two options in reverse.
Your script will look something like this:
# Isolate current found set
Go to Related Records [ Match found set from "ActionTO"; Using Layout "HoldingLayout" (HoldingTO)]
# Go back to Action layout to perform actions.
Go to Layout ["ActionLayout" (ActionTO)]
Show all records
#Restore found set
Go to Layout ["HoldingLayout" (HoldingTO)]
Go to Related Records [ Match found set from "HoldingTO"; Using Layout "ActionLayout" (ActionTO)]
I hope this makes sense and helps.
Thank you Orlando for taking the time to offer this suggestion. That's great.
Since I'm new to FM, I'll need some time to "work this through," but will get back to you as soon as I can put the related code together.