Title pretty much says it all. The script recorder makes it much, much easier for beginners to learn scripting. An excellent addition!
Hello, love the new script recorder!
(8 posts) (3 voices)-
Posted 2 years ago #
-
I think it could use some work but all in all I think that it is a fantastic addition. I noted that it did not capture a change in document type or some of the other features from the menus -- but all in all I really like it. Anything that can cut down on repetitive tasks.
Posted 2 years ago # -
There are a bunch of operations supported by PN that are not available directly to scripts. The current support is essentially limited to operations that Scintilla supports as direct commands, and search and replace. More will be added over time, but the essentials are there.
Posted 2 years ago # -
Noted that it does not add: Begin/EndUndoAction to the scripts.
Posted 2 years ago # -
Yes, this was because I was considering how to add support for recording undo actions. For the moment that means neither undo grouping or recording undo is supported. The problem is that undo is not necessarily predictable - what gets undone would be based partly on what you did before running the script. You also can't perform an undo in the middle of an undo group, or at least that doesn't seem to make sense to me.
Posted 2 years ago # -
But what about adding Begin/EndUndoAction automatically at the beginning and at the end of the script? Recording undo doesn't make much sense to me at first sight, but undoing the sequence of actions as a whole is pretty much what I would expect the undo command to do when it comes to a macro.
Posted 2 years ago # -
Yes, I think adding the Begin... and End... is probably the right thing to do and ignore mid-script undo. If you want this now, it's easy to add - the script recorder is mostly python code too!
Open pypn\record.py in your Programmer's Notepad directory and you have the code that handles the record. In
Recorder.__init__you'll see the initial text used for the script (self.script = ...) so you can add a call toscintilla.BeginUndoAction()there. To add EndUndoAction add the line in theRecorder.stopRecordingmethod right after the call toflushBuf, e.g.def stopRecording(self): """Comment is here""" self._flushbuf() self.script = self.script + "\tscintilla.EndUndoAction()\r\n" ...Posted 2 years ago # -
Thanks, great stuff.
Posted 2 years ago #
Reply
You must log in to post.