Can This Nested if/Then Be Improved Using a SWITCH?

@vincent_ardern I started a new topic for clarity. Thanks for offering to look at my macro for improvements.

Context: This is a macro to control Scrivener when using it for Screenwriting. One of its strengths is that it allows you to work on a document in small pieces. It can import an FDX screenplay file from Final Draft, and automatically split it by the scene headings.

After working with a split script in Scirvener, I like to do certain other tasks in Final Draft. I need to merge the split documents back into a single script and export it back out to FDX. Scrivener makes this a bit fussier than it should be.

You can't merge a folder by highlighting it. You have to select the contents in order to merge. If you select a bunch of folders and merge them, the result won't be a script file, it will be an empty folder with the merge text hidden inside. If you convert the folder back into a file, it's not a script file, so you have to convert it again.

I built this macro to cover all situations where the Merge command can be invoked. This macro determines what actions need to be done to create a merged Screenplay document.

The evaluations all work now, thanks to Peter's suggestion to refresh the Scrivener menus using Show Menu at the top of the macro.

I look forward to your suggestions.

Merge Control.kmmacros (62.9 KB)

Macro-Image