Here’s how to get the selection from the script history. This is how the Repeat command works.
def GetScriptHistoryView(): oLayout = Application.Desktop.ActiveLayout # See if the script history is a view of it's own oViews = oLayout.Views.Filter( "Script History" ) if oViews.Count == 0: oViews = oLayout.Views.Filter( "Script Editor" ) return oViews(0) oLog = GetScriptHistoryView() text = oLog.GetAttributeValue( "historyline" ) if oLog else "<Nothing>" print text
Can we clear it?
I’m afraid not. Copy, Clear All, and Select All are all implemented internally by the script editor.