
If it happened to be not read-only at all, then the first run set it Notepad++ read-only, and running it a second time was able to make it writeable and then runs Pretty Print correctly.

If it was just Notepad++ read-only, it also works. If the file was both windows read-only and Notepad++ read-only, that macro works on the first run. I was able to manually edit ↗ the macro to be: If you’re willing to maybe have to run the macro twice, when it happens to not be read-only and you thought it was, then having that 42028 in the macro is not a problem. If it’s the Notepad++ read-only flag (ID= 42028), then you cannot get the current state of that flag in a macro, and deciding whether or not to send that command is not possible (no logic in macros, either). Once you have a command ID, you can manually edit ↗ the shortcuts.xml file (in %AppData%\Notepad++\shortcuts.xml 🛈 for a normal installation)įor the second, if it’s the system-level read-only flag, then it’s easy, you just have to have the recorded value of the menu ID for the Clear Read-only Flag entry, which is ID= 42033, which you can get by recording the macro. But I will not guarantee it’s the same for you, or that it will remain consistent if you add or remove plugins. For me, the Pretty Print command is ID= 22137, and that stays consistent from run-to-run of my current setup. And there’s the Notepad++ read-only status, which you can toggle with Edit > Set Read-only.įor the first, if you are sure that the menu command IDs won’t be changing (ie, you are not installing new plugins anymore), then if you can figure out what the menu command ID is, it should stay the same from run to run. Which “read-only” attribute do you mean? There’s the Windows-style read-only attribute, which sets the flag in the filesystem, which you can clear with Edit > Clear Read-only Flag.Thus, the macro recorder does not record plugin commands. Plugin commands, like Format XML (aka Plugins > XML Tools > Pretty Print or similar in whatever plugin you are using), do not necessarily get a constant menu command ID, and macros must use those menu command IDs.

There are two main difficulties with your request:
