Retrieve script from script console

I accidentally closed the script console while it had a large script in it that took me a few hours to write and test. Is there a way to retrieve it? Rookie mistake…

Did you close the Designer in between then and now? When I open the Script Console it usually has the last code I wrote/executed in it.

Yes…I closed the whole designer unfortunately. Is there no log file somewhere that logs scripts that were run from the python script console? I ran the code multiple times in its finished state.

No, no such logging. The script console is pretty ephemeral, much like the DB Query browser.

That’s a bummer. But thanks for the help guys. The response here is fast.

This is from a while back, but I remembered having read it when I put together a simple function to save a copy of the code in the script console to a file when you run it. Put it in a shared module and call it at the top of the code.

More than once I’ve managed to lock up the designer with a loop or too much data in memory and lose my work. So, this has been at the back of my mind for a couple of years now.

Putting it here in case anyone would find it useful.


Thank, this is a great script to have.