alt cycle case Alternative Cycle Case

Tags: Extensions Writer


Alternative Cycle Case command with more intuitive behavior


Adds a LibreOffice Basic macro which re-implements Writer’s Cycle Case command (Shift+F3) in what I consider to be a more intuitive way:

  • Selection is respected (the built-in Cycle Case command may change the entire sentence or paragraph regardless of the current selection).

  • The next step applied depends on the current case of the text (the built-in command uses an internal counter instead so it may decide to apply, for example, ALL CAPS when the selection is already in all caps, giving the appearance that it is not working).

  • Issuing the command after typing a word cycles the case of the word (the built-in command requires the user to select the word they just typed or at least move the cursor back inside it).

This alternative behavior should also be more familiar to users coming from Microsoft Word. Installing the extension adds a Format ► Text ► Cycle Case (Alt.) entry in the main menu but the most convenient way to use the command is to assign a shortcut to the AltCycleCase.Main.CycleCase macro, either replacing the default Shift+F3, or a different one, such as Alt+F3.

WARNING: The macro supports noncontiguous selections using a hack because I could not get the UNO API to remember and restore a multi-range selection. It marks the selected text with a rarely used attribute (flashing characters), then searches for it to restore the selection after changing the text. If you use this attribute for other purposes, you may prefer to assign a shortcut to the AltCycleCase.Main.CycleCaseNoMultiselection macro which disables this hack and supports only contiguous selections.


Release List

Release: Initial release

Operating Systems:
License: GPL

Initial release of the extension. Noncontiguous selection is supported using a hack with character attributes. Main functionality should already work well but the extension is tested only on LO 7.1 under Windows 10. Feedback is welcome.

Other Extensions

Alternative Cycle Case

Alternative Cycle Case command with more intuitive behavior



Post your review

You cannot post reviews until you have logged in. Login Here.


  • Fulvio Bucci Oct 12, 2021, 6:23 PM (53 days ago)

    Installata su Linux.
    Estensione indispensabile per rendere funzionale la trasformazione maiuscolo/minuscolo.
    Do 5 stelle anche se la selezione non contigua non funziona, perché io non la utilizzo, mentre per il resto è perfetta.
    Macro assegnata alla classica combinazione Shift+F3, sostituendo l'assurda implementazione di default.

  • Filippo Giadrossi May 4, 2021, 10:01 PM (7 months ago)

    It does not work at all in MacOS X.
    It gives an error "BASIC runtime error.
    Property or method not found: getViewCursor."

    Anyway...thanks for your kind work :)

  • pibarnas Feb 18, 2021, 3:36 PM (10 months ago)

    I've had success at installing the extension in Windows 10 (LO 7.1) after cleaning my own configs (help>fix libreoffice>safe mode). Thank you once more! Your work is very appreciated!

    • MIhail Balabanov Feb 28, 2021, 12:17 PM (9 months ago)

      Hi, thanks for reporting this. I just found that the extension had somehow disappeared in my Win10/LO7.1 installation and when I tried to re-installed it, I had the same issue. Apparently, LO failed to create one of the temporary directories needed for deployment of the extension. Renaming my UNO packages cache folder (C:\Users\<my name>\AppData\Roaming\LibreOffice\4\user\uno_packages) fixed the problem and allowed the oxt to install correctly. I will try to investigate further when I have more time. Cheers!

  • pibarnas Feb 18, 2021, 2:42 AM (10 months ago)

    Great work!! Thank you very much! Worked as expected in linux (very well, I mean), but couldn't install in Windows (10/LO 7.1), for some reason. I found the otx extension downloaded, but when I click on it, a text box appeared saying it isn't found (an error). Will try with prior version, stable one.

RSS feed for reviews on this page | RSS feed for all reviews