You'll need to describe the design of your database and exactly what you want to do in more detail. In many cases, such a script is not needed.
Is each row in the screen shot from a sub summary layout part?
Thanks for your reply. The details of my design and its purpose are as follows:
I have a checking account file in which I record all the checks that are written, I added invoices that must be paid in the future, and thanks to your help, can create a check when I want to pay them. Each item is designated with an accounting field (accounting ID) and totaled by creating a sort by that field in a sub-summary part (screen shot enclosed). Great. Now I want to "Get" that amount and "post" it to the General Ledger, create a "journal entry" and in general be able to use it the same way I can manipulate any other piece of data. I just can't get a hold on it.
It's possible to loop through your records and use GetSummary to put those values in a variable, switch over to a layout based on the general ledger table, create a new record and use set field to copy the data form the variable to a field in the new record. But you'll have to carefully design that looping part of your script so that it only does this once for each group of records.
If there is any chance that you have a table with just one record for each of the accounts listed in your example, you can use that table with a relationship to the table that contains the data shown and then you can set up a script to loop through the records and Set Variable with the Sum Function can put the same sub total into the variable. The trick to doing this is to set up a relationship that only matches to the desired data which means matching by more than just the AccountID. You'd probably need an additional match field pair or two for matching either by a date range or a "paid"/"unpaid" status value on the indivdiual transaction record.