I know this is a low priority at the moment. But just wanted to mention it. I am writing a small script to append the selected text in the editor to a scrapbook file. I have 2 modes. A scrapbook per editor file or a scrapbook per directory.
So all it does, if there is selected text in the editor, it will append something like this to the scrapbook file.
[..ctime() - name of script]
The selected text
[End]
It's just often I cut out functions or blocks of code out of my scripts. I want to see that code again the next day or whatever. Maybe I want to copy it and reuse it. But yes, it's just a simple journal or cut history....
I will put the script in the site-packages directory and add it to the wrench
But, it's a 2 step process. . So I have to select the text, then choose the script from the wrench menu , then I have to do the actual cut operation.
@omz, it would be so nice if for these selection menu items, we could define a function that you called prior to calling your action. lets say the function we provide has to return a Boolean. If the function returns False you don't perform the operation, such as a cut, copy etc...A True value, you would proceed as normal. Of course, inside our called function will can implement whatever we want, before returning control. A scrapbook, SQLite journal , etc..
But with this sort of callback/hook system so nice and easy for us to extend Pythonista in more natural way, I think.
Let's say you had a type of property sheet with categories as an interface etc... As time permits, you could add other hooks into Pythonista's functionality . Another example might be 'on new .py' file, it might be possible to return a tuple (proceed, data). The data returned could be inserted into the file. So generically, maybe the return type is always a tuple.
I guess another way, would be just to add a cut selection method to the editor module. But personally, I love the idea of being able to so call hook into Pythonista's actions. Maybe there is a good reason you don't want to do this.
Ok, just my opinion