I started making a quick change to SimpleScript so that I could use it to automatically compile the chapters of a book into a single document, then got carried away and made some more substantial changes.
As it turns out, creating a dockable form isn't as hard as I had expected. So I changed the modal form to a dockable form instead. Since this was the most requested feature, I decided to upload it now rather than wait to finish all of the functions I had planned for version 1.1.
Version 1.07 also includes the following new features:
Run From Clipboard/ Validate Script on Clipboard menu options.
Run Script menu option has been relabeled to Simple Script.
Repeat Last Script automatic hot key has been removed, because there should be less of a need for it now that the form is no longer modal. You can still assign a hot key to it through the Notepad++ Shortcut mapper.
AppendFile and SaveToFile* functions have been added.
*For now, SaveToFile doesn't use the Notepad++ save because I'm still trying to figure out the best way to integrate it. Until I determine that, Notepad++ doesn't recognize that the file is saved if you use this function in a script.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) The Plug-In just seems to hang when I return from another application.
Could you list the exact steps that you perform when you get this error? I haven't been able to duplicate this error.
I did notice there are some ugly issues if you undock the Script Writer and then select Simple Script from the menu again. Maybe this is related?
2) I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
I named it this because I want it to be the most obvious choice on the menu, since it will be the one you use most. I used to call it "Run Script" for the same reason. I'm willing to consider other possibilities if you have any suggestions. (As the other poster suggested, "Script Writer" has potential, but I don't think it's quite as obvious)
3) If I dock the Script Writer ... at the bottom of N++, ... I will only have the script edit pane, without any buttons to push.
I know, and I plan to eventually fix it. I just wanted to get something uploaded quickly since people have been asking for a dockable Script Writer window. I had to make a judgment call about where to place the controls on the form, and I decided a vertical arrangement was the most appropriate. For now you'll just have to dock it on either the left or the right. Technically, you could also expand the bottom pane so it's tall enough to fit the whole Script Writer window, but that requires over half the screen.
3) When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
While the document is identical to the way it was before, technically it has changed. It's like if you type in some text and then delete it. You have performed some actions on it even if those actions resulted in the same document as before.
In most cases I would leave it at that and not worry about it, but since the programming to make sure the script isn't empty before running it is simple enough, I'll go ahead and fix it.
4) It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible.
I'm assuming the usual way you're going to get a script onto the clipboard is by designing it in another tab in Notepad++, so in most cases you'll have the script only one click away. This will especially be the case when Validating the script, because you'll most likely be using this option during the design stage.
If you can explain how you might get a script onto the clipboard without having that script available to view somewhere else, I'll consider displaying it somewhere.
That gives me another idea: Maybe I'll add a Validate Script in Document option. I won't include a Run Script in Document, because that would run the script on itself.
Thanks for your comments and suggestions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) The Plug-In just seems to hang when I return from another application.
> Could you list the exact steps that you perform when you get this error? I haven't been
> able to duplicate this error.
No special steps needed. I just open the Script Writer, undock it, leave N++ and return. Performing any action inside the Script Writer made it hang.
2) I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
> I named it this because I want it to be the most obvious choice on the menu, since it
> will be the one you use most. I used to call it "Run Script" for the same reason. I'm
> willing to consider other possibilities if you have any suggestions.
> (As the other poster suggested, "Script Writer" has potential, but I don't think it's
> quite as obvious)
I believe he suggested "Script Composer" with some comment on the word Writer...
3) When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
> but since the programming to make sure the script isn't empty before running it is
> simple enough, I'll go ahead and fix it.
Will you consider scripts containing only empty lines?
4) It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible.
> If you can explain how you might get a script onto the clipboard without having that
> script available to view somewhere else, I'll consider displaying it somewhere.
> That gives me another idea: Maybe I'll add a Validate Script in Document option. I won't
> include a Run Script in Document, because that would run the script on itself.
Well, not necessarily will the script still be available somewhere. If it was copied "some time before" and now results in an error... What would a user (have to) do? Paste it in a document or in the Script Writer anyway, to be able to check it.
It think it would be most transparent to run scripts only from the visible Script Writer editor pane. Isn't that were the favourites or loaded scripts end up as well? I think you may agree that running a script from the Clipboard at some time may result in unexpected behavior or errors.
What would the added value of the Validate Script in Document option be? I think it's the same way around the same "problem". If you want to run the script, you have to copy it to the clipboard and possibly paste it in the Script Writer anyway...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) No special steps needed. I just open the Script Writer, undock it, leave N++ and return. Performing any action inside the Script Writer made it hang.
I still couldn't get the problem to happen. Try downloading version 1.08 and see if it fixes it. If not, let me know and I'll look into it some more.
2) I believe he suggested "Script Composer" with some comment on the word Writer...
I'm still considering it. I'm really not satisfied with any of the choices; they all have drawbacks. The truth is that I'm kind of hoping to have a sudden stroke of genius and come up with the perfect label for the menu option.
3) Will you consider scripts containing only empty lines?
I think eventually I'll make it so that it ignores scripts that (a) have no lines, (b) have only blank lines, or (c) have only comments on the lines that aren't blank. That takes a little more programming, but it should be doable.
4) It think it would be most transparent to run scripts only from the visible Script Writer editor pane.
I already paste the clipboard contents into the Script Writer window with "Run From Clipboard." Maybe I should do the same with "Validate Script on Clipboard." I only spent about 30 seconds thinking about it because I had to hurry to get it finished, so it's not that I'm absolutely stuck on doing it one way. I'll have to put some more thought into it and decide whether to keep it as it is or to change it.
4b) What would the added value of the Validate Script in Document option be?
Just to save a couple of extra steps while you're designing a script. The Script Writer window is fine for writing short scripts, but I usually write longer ones in Notepad++ itself, especially since I occasionally use Simple Script to help me write scripts (try to wrap your mind around that). It would be nice to have a menu option to validate them while in the editor so I know they at least don't have any syntax errors before copying them into the Script Writer to run them. It's really just for convenience.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
2) I believe he suggested "Script Composer" with some comment on the word Writer...
> I'm still considering it. I'm really not satisfied with any of the choices; they all
> have drawbacks. The truth is that I'm kind of hoping to have a sudden stroke of genius
> and come up with the perfect label for the menu option.
Perhaps "Script Engine (Dialog)..." would be a good choice. I suggest adding the dots, indicating that a (docked) form will show.
3) Will you consider scripts containing only empty lines?
> I think eventually I'll make it so that it ignores scripts that (a) have no lines,
> (b) have only blank lines, or (c) have only comments on the lines that aren't blank.
> That takes a little more programming, but it should be doable.
Alternatively, you could check if any real action is performed during execution and only then decide to paste back the changed contents afterwards.
4) It think it would be most transparent to run scripts only from the visible Script Writer editor pane.
4b) What would the added value of the Validate Script in Document option be?
I would suggest to add some uniform behavior which would simply copy the selection (or the complete document) into the Script Writer's editor pane and show the Script Writer, both for Running and Validating.
If the Clipboard's contents are assumed to be visible somewhere anyhow, you would also skip the step requiring the user to copy these lines manually.
Perhaps some kind of a window list would be an outcome, allowing you to select a window to perform the current document's script (or selection) to, or allowing you to select the script to perform on the current document('s selection).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I downloaded Simple Script 1.07 and am having trouble when undocking the Script Writer. The Plug-In just seems to hang when I return from another application.
I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I dock the Script Writer (why not name the menu option like that?) at the bottom of N++, this is not very convenient. I will only have the script edit pane, without any buttons to push.
When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible. I wanted to suggest to show the Script Writer then, but where will the Clipboard contents be shown? Perhaps you could add a tab for that, to share with the current edit pane.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made a quick change to the plugin to fix an obvious bug that I didn't catch until after uploading version 1.07. Now if you undock the Script Writer and then select Simple Script from the menu again, it doesn't leave a "shadow" form behind. (If you want to see what I mean, try it in version 1.07)
While it didn't really hurt anything, it was pretty ugly.
If you already downloaded version 1.07, I highly recommend that you download version 1.08 right away.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally got the problem to happen. Apparently, if you click on any of the buttons when the form is undocked, it locks up Notepad++. It doesn't happen if the form is docked, which is strange. And it doesn't matter what the button does; I created a button that did nothing at all, and it still locked it up.
It happens in version 1.08 too, so until I can figure out what's going on, leave the Script Writer window docked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to suggest to enter the fully typed variant of your sourceforge.net email address in the About box of the Simple Script Plug-In.
This would be consistent with the address listed on your Developer Profile on sourceforge.net.
That's why the About box got me confused.
I really wonder which of the two addresses I would see in a reply to the email I tried to send... I guess this would have been the extended version, too.
But since my mail is rejected, I wonder... What's the use of mentioning the email address anyway?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One more suggestion: perhaps you could add string qualifiers to the hints in the Functions pane. I had to find out which character I had to use to get rid of the "Error 2: malformed string" message. Alternatively, you might mention the type of each value (string or text), but then again it would be nice to know what character is used to identify that type.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I started making a quick change to SimpleScript so that I could use it to automatically compile the chapters of a book into a single document, then got carried away and made some more substantial changes.
As it turns out, creating a dockable form isn't as hard as I had expected. So I changed the modal form to a dockable form instead. Since this was the most requested feature, I decided to upload it now rather than wait to finish all of the functions I had planned for version 1.1.
Version 1.07 also includes the following new features:
Run From Clipboard/ Validate Script on Clipboard menu options.
Run Script menu option has been relabeled to Simple Script.
Repeat Last Script automatic hot key has been removed, because there should be less of a need for it now that the form is no longer modal. You can still assign a hot key to it through the Notepad++ Shortcut mapper.
AppendFile and SaveToFile* functions have been added.
*For now, SaveToFile doesn't use the Notepad++ save because I'm still trying to figure out the best way to integrate it. Until I determine that, Notepad++ doesn't recognize that the file is saved if you use this function in a script.
In response to some of the above questions:
1) The Plug-In just seems to hang when I return from another application.
Could you list the exact steps that you perform when you get this error? I haven't been able to duplicate this error.
I did notice there are some ugly issues if you undock the Script Writer and then select Simple Script from the menu again. Maybe this is related?
2) I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
I named it this because I want it to be the most obvious choice on the menu, since it will be the one you use most. I used to call it "Run Script" for the same reason. I'm willing to consider other possibilities if you have any suggestions. (As the other poster suggested, "Script Writer" has potential, but I don't think it's quite as obvious)
3) If I dock the Script Writer ... at the bottom of N++, ... I will only have the script edit pane, without any buttons to push.
I know, and I plan to eventually fix it. I just wanted to get something uploaded quickly since people have been asking for a dockable Script Writer window. I had to make a judgment call about where to place the controls on the form, and I decided a vertical arrangement was the most appropriate. For now you'll just have to dock it on either the left or the right. Technically, you could also expand the bottom pane so it's tall enough to fit the whole Script Writer window, but that requires over half the screen.
3) When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
While the document is identical to the way it was before, technically it has changed. It's like if you type in some text and then delete it. You have performed some actions on it even if those actions resulted in the same document as before.
In most cases I would leave it at that and not worry about it, but since the programming to make sure the script isn't empty before running it is simple enough, I'll go ahead and fix it.
4) It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible.
I'm assuming the usual way you're going to get a script onto the clipboard is by designing it in another tab in Notepad++, so in most cases you'll have the script only one click away. This will especially be the case when Validating the script, because you'll most likely be using this option during the design stage.
If you can explain how you might get a script onto the clipboard without having that script available to view somewhere else, I'll consider displaying it somewhere.
That gives me another idea: Maybe I'll add a Validate Script in Document option. I won't include a Run Script in Document, because that would run the script on itself.
Thanks for your comments and suggestions.
1) The Plug-In just seems to hang when I return from another application.
> Could you list the exact steps that you perform when you get this error? I haven't been
> able to duplicate this error.
No special steps needed. I just open the Script Writer, undock it, leave N++ and return. Performing any action inside the Script Writer made it hang.
2) I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
> I named it this because I want it to be the most obvious choice on the menu, since it
> will be the one you use most. I used to call it "Run Script" for the same reason. I'm
> willing to consider other possibilities if you have any suggestions.
> (As the other poster suggested, "Script Writer" has potential, but I don't think it's
> quite as obvious)
I believe he suggested "Script Composer" with some comment on the word Writer...
3) When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
> but since the programming to make sure the script isn't empty before running it is
> simple enough, I'll go ahead and fix it.
Will you consider scripts containing only empty lines?
4) It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible.
> If you can explain how you might get a script onto the clipboard without having that
> script available to view somewhere else, I'll consider displaying it somewhere.
> That gives me another idea: Maybe I'll add a Validate Script in Document option. I won't
> include a Run Script in Document, because that would run the script on itself.
Well, not necessarily will the script still be available somewhere. If it was copied "some time before" and now results in an error... What would a user (have to) do? Paste it in a document or in the Script Writer anyway, to be able to check it.
It think it would be most transparent to run scripts only from the visible Script Writer editor pane. Isn't that were the favourites or loaded scripts end up as well? I think you may agree that running a script from the Clipboard at some time may result in unexpected behavior or errors.
What would the added value of the Validate Script in Document option be? I think it's the same way around the same "problem". If you want to run the script, you have to copy it to the clipboard and possibly paste it in the Script Writer anyway...
1) No special steps needed. I just open the Script Writer, undock it, leave N++ and return. Performing any action inside the Script Writer made it hang.
I still couldn't get the problem to happen. Try downloading version 1.08 and see if it fixes it. If not, let me know and I'll look into it some more.
2) I believe he suggested "Script Composer" with some comment on the word Writer...
I'm still considering it. I'm really not satisfied with any of the choices; they all have drawbacks. The truth is that I'm kind of hoping to have a sudden stroke of genius and come up with the perfect label for the menu option.
3) Will you consider scripts containing only empty lines?
I think eventually I'll make it so that it ignores scripts that (a) have no lines, (b) have only blank lines, or (c) have only comments on the lines that aren't blank. That takes a little more programming, but it should be doable.
4) It think it would be most transparent to run scripts only from the visible Script Writer editor pane.
I already paste the clipboard contents into the Script Writer window with "Run From Clipboard." Maybe I should do the same with "Validate Script on Clipboard." I only spent about 30 seconds thinking about it because I had to hurry to get it finished, so it's not that I'm absolutely stuck on doing it one way. I'll have to put some more thought into it and decide whether to keep it as it is or to change it.
4b) What would the added value of the Validate Script in Document option be?
Just to save a couple of extra steps while you're designing a script. The Script Writer window is fine for writing short scripts, but I usually write longer ones in Notepad++ itself, especially since I occasionally use Simple Script to help me write scripts (try to wrap your mind around that). It would be nice to have a menu option to validate them while in the editor so I know they at least don't have any syntax errors before copying them into the Script Writer to run them. It's really just for convenience.
2) I believe he suggested "Script Composer" with some comment on the word Writer...
> I'm still considering it. I'm really not satisfied with any of the choices; they all
> have drawbacks. The truth is that I'm kind of hoping to have a sudden stroke of genius
> and come up with the perfect label for the menu option.
Perhaps "Script Engine (Dialog)..." would be a good choice. I suggest adding the dots, indicating that a (docked) form will show.
3) Will you consider scripts containing only empty lines?
> I think eventually I'll make it so that it ignores scripts that (a) have no lines,
> (b) have only blank lines, or (c) have only comments on the lines that aren't blank.
> That takes a little more programming, but it should be doable.
Alternatively, you could check if any real action is performed during execution and only then decide to paste back the changed contents afterwards.
4) It think it would be most transparent to run scripts only from the visible Script Writer editor pane.
4b) What would the added value of the Validate Script in Document option be?
I would suggest to add some uniform behavior which would simply copy the selection (or the complete document) into the Script Writer's editor pane and show the Script Writer, both for Running and Validating.
If the Clipboard's contents are assumed to be visible somewhere anyhow, you would also skip the step requiring the user to copy these lines manually.
Perhaps some kind of a window list would be an outcome, allowing you to select a window to perform the current document's script (or selection) to, or allowing you to select the script to perform on the current document('s selection).
I downloaded Simple Script 1.07 and am having trouble when undocking the Script Writer. The Plug-In just seems to hang when I return from another application.
I think the Simple Script submenu option could have a better name than the same as the Plug-In menu item itself.
If I dock the Script Writer (why not name the menu option like that?) at the bottom of N++, this is not very convenient. I will only have the script edit pane, without any buttons to push.
When I hit the Run button on an empty script, this results in the current document getting a "changed" status, while in fact nothing has changed.
It's not very informative to get some error message on Validate Script on Clipboard (I suggest: in/from Clipboard) when the Script Writer is not visible. I wanted to suggest to show the Script Writer then, but where will the Clipboard contents be shown? Perhaps you could add a tab for that, to share with the current edit pane.
I made a quick change to the plugin to fix an obvious bug that I didn't catch until after uploading version 1.07. Now if you undock the Script Writer and then select Simple Script from the menu again, it doesn't leave a "shadow" form behind. (If you want to see what I mean, try it in version 1.07)
While it didn't really hurt anything, it was pretty ugly.
If you already downloaded version 1.07, I highly recommend that you download version 1.08 right away.
Perhaps you could create a new thread for the message above, about version 1.08.
I just downloaded it, ran N++, opened the Script Writer, undocked it...
and N++ stopped functioning alltogether.
I finally got the problem to happen. Apparently, if you click on any of the buttons when the form is undocked, it locks up Notepad++. It doesn't happen if the form is docked, which is strange. And it doesn't matter what the button does; I created a button that did nothing at all, and it still locked it up.
It happens in version 1.08 too, so until I can figure out what's going on, leave the Script Writer window docked.
I would like to suggest to enter the fully typed variant of your sourceforge.net email address in the About box of the Simple Script Plug-In.
This would be consistent with the address listed on your Developer Profile on sourceforge.net.
That's why the About box got me confused.
I really wonder which of the two addresses I would see in a reply to the email I tried to send... I guess this would have been the extended version, too.
But since my mail is rejected, I wonder... What's the use of mentioning the email address anyway?
One more suggestion: perhaps you could add string qualifiers to the hints in the Functions pane. I had to find out which character I had to use to get rid of the "Error 2: malformed string" message. Alternatively, you might mention the type of each value (string or text), but then again it would be nice to know what character is used to identify that type.
The HOME and END keys don't seem to have any effect in the Script Writer.