paynekj wrote:
With the selection saved I get a message in the Error Console:
GIMP Warning
The active layer is not visible.
The documentation for gimp-selection-save says it creates a new channel, so it appears that it leaves the new channel as the active drawable. Therefore you may need to remember which is the active layer before you save the selection and then re-activate it after saving.
And it has been that way for a long time (at least in 2.8...). No need for a script, "Select>Save to channel" has the same effect. This said, in a script, it shouldn't matter, the initial active drawable is passed as a parameter and this is what the script code should be using (instead of fetching the active layer again(*))
(*) also because the script could be called from another, who would want something to be done to a specific layer which isn't the active layer. Script don't act on the active layer, they act on the layer passed as a a parameter, which, when called from the UI, will usually (but not always...) be the active layer.