It sounds like he wants to display the error message, but continue with the remainder of the column rename functions. You could do this with a modal dialog (requires you to click "OK" before the script will proceed) or a caption window (does not stop script or require a response), depending on your preference. In the below examples, "old_name" refers to the column name you want to locate and replace and "new_name" refers to the name you want to replace it with.
col_names = dt << get column names(string);
if ( !contains( col_names, "old_name" ),
dlg = dialog( "No old_name column",
button( "Cancel" ), button( "OK" ) ),
If( dlg["Button"] == -1, Throw() ),
Column( "old_name" ) << Set Name( "new_name" )
);
To use the non-modal caption command:
col_names = dt << get column names(string);
if ( !contains( col_names, "old_name" ),
Caption( {x,y}, "No old_name column" );
Wait( 2 );
Caption( remove ),
Column( "old_name" ) << Set Name( "new_name" )
);
x and y in the caption refer to display coordinates, so if your display resolution is 1024 x 768, using {500,350} will give you a caption window that is roughly in the middle of your screen. You can also alter the time of the 'wait' command if the message is displaying too long (or not long enough).
You'll need to repeat the conditional for each column, replacing "old_name" and "new_name" each time.