qscintilla_docs icon indicating copy to clipboard operation
qscintilla_docs copied to clipboard

Add Macros

Open JakobDev opened this issue 5 years ago • 1 comments

It would be really nice if you add macros to the documentation.

Here a description how they work: First you need to create a macro with the QsciMacro Class. It takes QsciScintilla as argument. macro = QsciMacro(self.editor)

You can start recording macros with startRecording(). It doesn't need to be in a thread or something else. macro.startRecording()

You can stop recording with endRecording(). macro.stopRecording()

You can play a recorded macro with play() macro.play()

If like to save a macro, call macro.save(). If will return a string, that can be saved in a file or something else.

f = open("myMacro.txt","w",encoding="utf-8")
f.write(macro.save())
f.close()

You can load a macro from a string, that you created with macro.save() with macro.load().

macro = QsciMacro(self.editor)
f =open("myMacro.txt","r",encoding="utf-8")
macro.load(f.read())
f.close()

macro.clear() clears a macro.

That was all I found about about macros. I hope it helps you to complete your great documentation.

JakobDev avatar Oct 30 '19 15:10 JakobDev

@JakobDev Thanks for the example. Yes, I will add it as soon as I can. Need to play with it for a bit to get the hang of it.

Cheers

matkuki avatar Oct 31 '19 10:10 matkuki