[Solved] Altsearch: unable to use shortcuts

Issues with installing under all GNU/Linux Distributions
Post Reply
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

[Solved] Altsearch: unable to use shortcuts

Post by kocj »

I run into a similar issue as viewtopic.php?f=6&t=103408&p=504281&hil ... ch#p504281 using altsearch.

I wanted to set up a new shortcut to run a batch. Now i get this error message.
https://imgur.com/a/jUytiqh
06xizbW.png
I still can manually run the batch form the altsearch window. Unfortunately i do not have a recent backup. My other macros all run.

I tried to uninstall and reinstall altsearch. That did not help.
I used a clean user profile and run in the same issue.

I am on Debian and use Libreoffice 7.0.1.

According to the error message i guess that i has to do with the file stored in /user/basic/standard/AltSearchBatchs.xba witch content is

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AltSearchBatchs" script:language="StarBasic">REM  *****  BASIC  *****
Option Explicit

&apos; Warning this module is modified by execution of AltSearch macro!
&apos; Contains subroutines for assign key shortcut for AltSearch&apos;s batchs.
&apos; Do not change any character unless you know what you do!


Sub Altsearch___dialog
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch") &apos;load AltSearch library
 _AltSearch
End sub


Sub Altsearch___Find_next
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
 _FindNext
End sub


Sub Altsearch___Find_previous
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
 _FindBack
End sub





Sub LO_Markup_nextgen_ctrl_alt_L
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
 _AltSearch("LO-Markup-nextgen-ctrl-alt-L")
End sub



Sub Clammer_farbe
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
 _AltSearch("Clammer farbe")
End sub



Sub 0
 On Error resume next
 GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
 _AltSearch("New search")
End sub
I am basically a nob with macros, so please direct me, if you need other informations.

Thank you
Last edited by robleyd on Fri Jun 18, 2021 12:29 pm, edited 3 times in total.
Reason: Add green tick
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
Bidouille
Volunteer
Posts: 577
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Altsearch: unable to use shortcuts

Post by Bidouille »

A string like:

Code: Select all

GlobalScope.BasicLibraries.LoadLibrary("AltSearch")
can not work. Don't use an HTML syntax in Basic.

Note that question about macro should be posted in dedicated section.
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

Re: Altsearch: unable to use shortcuts

Post by kocj »

Last edited by kocj on Fri Jun 18, 2021 12:13 pm, edited 1 time in total.
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

Re: [Solved] Altsearch: unable to use shortcuts

Post by kocj »

Found a solution

To assign a short cut open the extension and change to the batch view. The click on the batch and then "key shortcut", leave the second window "auxiliary subroutine" as it is. As expected the shortcut trows the error.


Go to "Tools" > "Macors" > "Edit Macros". A new stanza beginning with "sub 0" will be there. Change the 0 with AltSearch___Name_of_your_batch.


Go to "Tools" > "Costumize" > "Keyboard", In the "Category" field navigate to > "LibreOffice Macros" > "Standard" > "AltSearchBatchts". In the functions field select AltSearch___Name_of_your_batch and assign the shortcut again.

This worked for me.
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
Post Reply