(Calc 24.8.3.2, Ubuntu 24.04)
Since it has been SO long since I did any macro programming, I decided to just record a simple macro to get started (consisting of the following keystrokes: <F2> <backspace> <move-left> <backspace> <Ctrl-Enter> <Enter>), but the recorded macro is basically a null function, as below. I also recorded the same macro, but with a trailing <move-down> keystroke and it actually moves down one cell after not editing the cell I started on.
Suggestions? (I tried reading the help but got lost in the object hierarchy; all I want to do is automate my editing of several hundred cells with extraneous whitespace.)
One last note - the material between the trailing space character and the other space character I was deleting is a link with text that differs from the URL. Regex substitution only preserved the text, not the URL.
REM ***** BASIC *****
sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SetInputMode", "", 0, Array())
end sub