Libreoffice plugin. Script to launch Zotero

I frequently try to insert a citation in libreoffice without remembering to first launch zotero, which returns the obvious error message.
I made the following bash script:
______________________________
#! /bin/bash
SERVICE=zotero ;
if ps ax | grep -v grep | grep $SERVICE ;
then echo "already running" ;
else /home/darwin/Zotero_linux-x86_64/run-zotero.sh ;
fi
______________________________

I run it by appending:
Shell ("bash /home/darwin/zottt.sh")
in the "Add Citation macro"

The only problem is that the first time I run the macro, I still get the error message, since Zotero takes a couple of seconds to launch.
I can then click ok to the error message and run the macro again, but I would like to polish it.
In a nutshell:
what is the equivalent of the bash SLEEP command in libreoffice's Visual Basic?

Thanks in advance and congratulations on your ever more precise and useful work.
Sign In or Register to comment.