Here is an example script that does what you indicated you wanted
Names Default To Here( 1 );
// Get the list of the pictures
filelist = Files In Directory( "$SAMPLE_IMAGES" );
// Loop across all of the pictures, cropping and saving
For( i = 1, i <= N Items( filelist ), i++,
// Using a Substitute because the extension value needs to be an expression,
// not a literal
Eval(
Substitute(
Expr(
img = Open( "$SAMPLE_IMAGES\" || filelist[i], __extension__ )
),
Expr( __extension__ ), Parse( Word( -1, filelist[i], "." ) )
)
);
// Allow time for the image to be read
Wait( 1 );
// Crop the image
img << Crop( Left( 50 ), Right( 100 ), Top( 60 ), Bottom( 150 ) );
// Save the image to a new folder
img << Save Picture( "<path to save folder>" || filelist[i], Word( -1, filelist[i], "." ) );
);
// Create a new table
New Table( "Untitled",
Add Rows( N Items( filelist ) ),
New Column( "image", Expression, "None", Set Values( {} ) )
);
// Populate the image column
foreachrow(
:image = newimage("<path to save folder>" || filelist[row()])
);
Jim