Overwrite toolbar on import

I'm trying to script the import of a toolbar. I'm generating the toolbar automatically, by having a script write the XML .dop file. As a result, the toolbar can need to be updated frequently.

When I use a command such as: Toolbar "D:\blah.dop" IMPORT

It will always popup an annoying window indicating the toolbar already exists and asking me to rename it. What I want to do is overwrite the toolbar with the updated .dop file and have it show up in my lister. If I rename it, I would have to update my lister config each time to remove the old one and add the new one. I don't even see a way to script the removal of a toolbar.

How can I automate this task?

Have you tried making the script delete the old toolbar copy before importing a new one? It'll be under /dopusdata/buttons

This seems to work:Toolbar "blah" CLOSE Delete "/dopusdata\Buttons\blah.dop" FORCE dopusrt /cmd Toolbar "D:\blah.dop" IMPORT Toolbar "blah" STATE=top LINE=1

Do you need dopusrt for the 3rd line?

Yes, without it DOpus will not load the new version of the toolbar. Maybe a timing problem.

Thanks for the replies guys. I wasn't aware of the "Delete" option to remove the toolbar. This is working just great for me.

As Kundal indicated Dopus won't actually pick up any content changes to the toolbar. Instead of using the dopusrt line I went with this:

Go . Layout="Directory Organizer"

This refreshes all of the toolbars and shows the content change. Thanks. BTW Leo can you edit the topic of this post to fix the "Import" misspelling. That will make it easier for other people to find this topic in the future.