How to get last opend file content

Hi, I‘m new here, I usethis.app.workspace.activeLeaf.view.data to get current file content, but how can I get previous one. :heart:

I try this.app.workspace.lastOpenFiles, but it gives some string, not object.

I want to create a plugin to read “.py” file and highlight.
so I want to open it ,and auto add a marker ```python ```` to file start.
and when I switch file ,delete last one’s marker