Thanks for all the input and help! I was not aware of scripting index it was a big help. I posted the code I am using below as my final version
Names Default To Here( 1 );
Clear Symbols();
dt = Current Data Table();
///////////////////////////////////
// Setting Variables for script ///
rev_scale =1;
mean_median = 0; //mean=0, median=1
print(mean_median);
///////////////////////////////////
//gets all columns that are continous and stores that in a list as strings.
colList = dt << get column names( continuous, string );
// Create a temporary subset where the columns are the column list, selects all rows,
// invisible makes it so you don't see the datatable on screen since it is temporary
dtsub = dt << subset(columns(colList), selected rows(0),invisible);
// Move the data into a matrix this will be used later to get min, max, median|mean
allData = dtsub << get as matrix;
// Close the no longer needed temporary data table
close(dtsub, nosave);
// Calculate the statistics across the full data matrix
myMax = Maximum(allData);
myMin = Minimum(allData);
if(mean_median == 0,
myMid = Mean(allData),
myMid = Median(allData)
);
print(myMax);
print(myMin);
print(myMid);
// Run for loop over data table with the min, max and median|mean calculated from above
// gradient color scheme needs to be set.
if(rev_scale == 1,
For( i = 1, i <= N Items( colList ), i++,
Eval(
Substitute(
Expr(
Column( __col__ ) <<
set property(
"color gradient",
{"Green Yellow Red",
Range( {__Max__, __Min__, __Mid__} ),"Reverse Scale"}
) << Color Cell by Value( 1 );
),
Expr( __col__ ), colList[i],
Expr( __Max__ ), myMax,
Expr( __Min__ ), myMin,
Expr( __Mid__ ), myMid
)
);
);
,
For( i = 1, i <= N Items( colList ), i++,
Eval(
Substitute(
Expr(
Column( __col__ ) <<
set property(
"color gradient",
{"Green Yellow Red",
Range( {__Max__, __Min__, __Mid__} )}
) << Color Cell by Value( 1 );
),
Expr( __col__ ), colList[i],
Expr( __Max__ ), myMax,
Expr( __Min__ ), myMin,
Expr( __Mid__ ), myMid
)
);
);
);