How can I AutoClose a docked floating toolbar?

I open a floating docked toolbar when starting another application.

How can I autoclose only this toolbar (without pressing a button) when I exit my application?

Autoclose the floating toolbar

More detail needed.

It depends on the program, how you're opening it, what you're opening it from, and potentially what the toolbar buttons are doing as well.

Both my java program and the Dopus toolbar are opened from the same Dopus button on a different toolbar.

Run the program synchronously and have the same button close the toolbar after running it.

Ingenious! Leo, your solution works!

For others viewing this post I added the following to my toolbar button that launches my application and a toolbar, then closes the toolbar after the application ends:

@async:"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd showToolbar_Tos
@sync:"C:\Users\Me\AppData\Local\myJavaApp\myJavaApp.exe"
Toolbar CLOSE NAME=Tos STATE=float

Additional Info:
The showToolbar_Tos is my script and contains the following:

Toolbar NAME=Tos APPBAR=Top POS 3841,0 FLOAT=toplevel UPDATE

Note: The approach of including the Toolbar command, as the first line, DOES NOT WORK for me (although I thought it should). With this approach, instead of first opening the toolbar, Dopus waits until the @sync: program closes and then runs the Toolbar command appearing before the @sync: (perhaps I am missing something).

In other words, the following does not work for me:

Toolbar NAME=Tos APPBAR=Top POS 3841,0 FLOAT=toplevel UPDATE
@sync:"C:\Users\Me\AppData\Local\myJavaApp\myJavaApp.exe"
Toolbar CLOSE NAME=Tos STATE=float