I do not find consecutive spaces when using $shortfn. It should be flipping either the pathname or filename portions to a short-name when there's a foldername or filename that's not a valid 8.3 name, and doublespaces isn't valid in an 8.3 name.
You can pass consecutive spaces to an $identifier, but not to a /command like /bread because of the way the command line is parsed before handing to them. Fortunately, $parms has a separate context within $findfile() than it has during an event. If you use $findfile() within ON TEXT you can see that it echoes $parms as a different value than within the event itself.
You'll need to validate whether the filename contains doublespaces then alter the filename to be $shortfn($parms) instead of $1-.
size_alias {
var %a $1 | if ($regex($1,\x20\x20)) var %a $shortfn($1)
echo 4 -s %a $sha1(%a,2) / $sha1($1,2)
bread $qt(%a) 0 $file(%a).size &temp | echo 3 -s binvar size $bvar(&temp,0)
return %a
}
//noop $findfile($mircdir,*.jpg,0,2,echo 5 -s x $size_alias($parms) )
This shows %a being filled with the $parms passed to it as the $1 parameter. If size_alias had been called as a /command it would not have seen the double spaces. This will show the short-filename if either the foldername or filename contains double spaces.
The red line demonstrates $sha1 gives the same answer regardless whether it sees the double-space-name or the $shortfn.
The green line shows /bread using the $shortfn workaround
The maroon line shows you can get a display of filenames where the items containing doublespaces have been flipped into being short filenames.