I have been using the very useful AltSearch extension with key shortcuts in OO (on macOS) for many years. Recently I changed to LO (v.24.2.6.2 on macOS 13.6.9) but found that key shortcuts do not work. Earlier versions of LO on mac had the same problem.
To assign a shortcut key to a Batch in AltSearch you use the GUI shown.
But I get this Libre message when trying to assign a shortcut key to any batch including my own or in-built AltSearch batches.
A Scripting Framework error occurred while running the Basic script vnd.sun.star.script:Standard.AltSearchBatchs.0?language=Basic&location=application.
Message: The following Basic script could not be found:
library: ‘Standard’
module: ‘AltSearchBatchs’
method: ‘0’
location: ‘application’
Note:
All batches run successfully from AltSearch or from LO ‘Organize Batches’.
I can assign keys to custom macros recorded directly in LO (not via AltSearch) which are saved to ‘Standard/Module 1’ etc.
From my investigations it seems that:
All built-in and user-built AltSearch Batch scripts are saved on macOS in the single .txt file:
/Users/myname/Library/Application Support/LibreOffice/4/user/config/AltSearchScript.txt
When you assign a key to an AltSearch batch no extra macro is added to the list at LO/My Macros & Dialogs/Standard/AltSearchBatchs but an extra subroutine is added to each of the 3 existing macros that reads (for example):
Sub 0
On Error resume next
GlobalScope.BasicLibraries.LoadLibrary(“AltSearch”)
_AltSearch(“Para to line-break”)
End sub
- and that has the Error Message ‘BASIC syntax error. Symbol expected’ on the first line ‘sub 0’ of the subroutine.
My Attempts to Fix:
There is no such ‘AltSearchBatchs.0’ so I tried adding xba (can’t do) or nothing (crashes) in the ‘Assign to key_Auxiliary Subroutine’ window instead of 0 (zero).
Note: from reading Andrew Pitonak’s excellent ‘OpenOffice.org Macros Explained’ (a bit beyond my scope) .0 (zero) is an illegal start to a sub Name.
So then I tried adding a custom name to the subroutine (e.g. ‘Para_to_Linebreak’) either via the AltSearch fill-in or by editing the ‘AltSearchBatchs’ macro. This does fix the BASIC error message and does add a new macro to the Standard/AltSearchBatchs index. But when I apply a key shortcut to that batch using LO ‘Macros_Organise’ that key shortcut doesn’t work either - there is no response (no error message, no run of the macro).
And, yes, I restart LO after each such change.
Any help would be hugely appreciated.