Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Macros #12

Open
JakobDev opened this issue Oct 30, 2019 · 1 comment
Open

Add Macros #12

JakobDev opened this issue Oct 30, 2019 · 1 comment

Comments

@JakobDev
Copy link

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.

@matkuki
Copy link
Owner

matkuki commented Oct 31, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants