Thanks! That clears it up.
The output *is* the intended behaviour. It takes the attribute byte of each 4x4 tile region on the map and outputs it, going left to right, iterated top to bottom. This results in 4096 bytes representing the entirety of the map.
I'll look into an action for just saving current selection. Pressing ctrl+a once, that means the currently viewed portion of the screen.
Additionally, the file helped me find another bug: It seems the status readout bar provides wrong data element on maps that aren't exactly 1 screen wide. Thanks for providing the opportunity!
Many thanks to you, the retro community owes you too much! I would like to take this opportunity to recommend this web application, perhaps this tool will be useful for your projects: https://rilden.github.io/tiledpalettequant/