That is a weird way to do it, shortcodes are really meant for inserting into the editor, if you want to program some functionality it’s better to go straight into the template/code itself.
//check if post format is gallery type
if ( has_post_format( 'gallery' ) {
echo do_shortcode('');
}