You probably want to inspect your outputDesc a bit further. I have a DescriptorToObject routine that I use. It shows me this as the output of Canvas Size.
Result: ({relative:true, width:{type:"#Pxl", typeString:"pixelsUnit", value:-647}, height:{type:"#Pxl", typeString:"pixelsUnit", value:-748}, horizontal:{type:"HrzL", typeString:"horizontalLocation", value:"Rght", valueString:"right"}, vertical:{type:"VrtL", typeString:"verticalLocation", value:"Bttm", valueString:"bottomEnum"}})
See the routine in the attached script.
And you might not get anything out if user just presses ok.
But I think you want this:
var idHrzV = outputDesc.getEnumerationValue( stringIDToTypeID( "horizontal" ) );
var idVrtV = outputDesc.getEnumerationValue( stringIDToTypeID( "vertical" ) );