How could I programmatically write results of Show Expression to a file?

Here is a practical example: ** Controlling sound player object’s size **. Imagine you got some expression, say this one:

Integrate[1/Sin[x], x]
(* output *)
-Log[Cos[x/2]] + Log[Sin[x/2]]

To get programmatically underlying box expression use

exp = ToBoxes[%]
(* output *)
RowBox[{RowBox[{"-", 
    RowBox[{"Log", "[", 
      RowBox[{"Cos", "[", FractionBox["x", "2"], "]"}], "]"}]}], "+", 
  RowBox[{"Log", "[", 
    RowBox[{"Sin", "[", FractionBox["x", "2"], "]"}], "]"}]}]

To put it back together use

RawBoxes[%]

To save it as a file I’d recommend .m format

Export["exp.m", exp]

Here how you import it back

Import["exp.m"]

And put it back together

RawBoxes[%]

I am not sure what you are planning to do, but it seems to defeat the purpose, because if you’d like to preserve expression exactly in a file you could just use native Mathematica .m format.