Skip to content

Need {CotEditorXOutput=NewDocumentOnlyIfOutput} or similar scripting option #2033

@Monty

Description

@Monty

Current issue

It's frustrating that when I use # %%%{CotEditorXOutput=NewDocument}%%% it always creates a document even when no new document is warranted, especially after I generate an error alert.

I wind up echoing some explanatory text so that the new document is not completely empty.

Here's an example where I'd like to skip the output after an error alert. If no error I want to generate the new document.

shellcheck.sh

I'm sure you can come up with a shorter or more meaningful name. Or perhaps some osascript to prevent a blank document from being generated. I have to exit early in this script to prevent it continuing, but a non-zero exit gets the default AppleScript "status 1" error which is not descriptive.

I'm open to anything more creative.

The solution you'd like

A way to conditionally not generate a new blank document during {CotEditorXOutput=NewDocument}

Alternatives you've considered

No response

CotEditor version

Version 6.2.4 (794)

macOS version

Tahoe 26.3.1

Additional context

No response

Metadata

Metadata

Assignees

Labels

featurefeature requests from users

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions