plaintext: Moving some code from "plaintext" function to "get_attached_data" to have it accessible for non-plaintext exports