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.