[Solved] Macro to turn on the document navigator

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
eminkovitch
Posts: 14
Joined: Sun Feb 19, 2017 4:59 am

[Solved] Macro to turn on the document navigator

Post by eminkovitch »

Hi, has anyone tried to automate this? You can do it from the View Sidebar menu, then click on Navigator icon. Useless steps, but I can't find any way to automate this. It can't capture the macro for this task. I got as far as turning the sidebar on and off. Can anyone shed any light on how to go further, and turn on the document nav?

Thanks very much indeed.
Eliot
Last edited by Hagar Delest on Sun Feb 19, 2017 7:18 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 4.1.3 on Windows 8, Leonovo laptop with 5GB ram and 1Ghz dual-core processor
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Macro to turn on the document navigator

Post by robleyd »

You can use F5 to toggle a floating Navigator window, of course.

Is your problem that you want the Navigator to be visible when you open a document? You can do this with the floating window if you have it open when you close AOO - it should then be visible when next you open an AOO document.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Macro to turn on the document navigator

Post by FJCC »

Sorry, I don't understand how a macro will help in this case. The Navigator can be accessed with the key F5, from the menu View -> Navigator, from an icon on the main tool bar, or from the side bar. Once it is opened with any of those methods, it can be docked at the left or right edge of the window just by dragging it to that location and then it will be permanently visible. If a macro were created to open it, I don't see how it would be more convenient than one of those options. What am I missing?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
eminkovitch
Posts: 14
Joined: Sun Feb 19, 2017 4:59 am

Re: Macro to turn on the document navigator

Post by eminkovitch »

Thanks for your reply. My use case is that some documents require a navigator and others do not, and I waste time looking for it and switching it on or off. Macro would be perfect for this - I have made one that opens the sidebar, or closes, depending on the document. Works nicely, but I can't find anything that would manipulate the navigator itself. Do you have any clues?

Cheers
Eliot
OpenOffice 4.1.3 on Windows 8, Leonovo laptop with 5GB ram and 1Ghz dual-core processor
eminkovitch
Posts: 14
Joined: Sun Feb 19, 2017 4:59 am

Re: Macro to turn on the document navigator

Post by eminkovitch »

FJCC wrote:Sorry, I don't understand how a macro will help in this case. The Navigator can be accessed with the key F5, from the menu View -> Navigator, from an icon on the main tool bar, or from the side bar. Once it is opened with any of those methods, it can be docked at the left or right edge of the window just by dragging it to that location and then it will be permanently visible. If a macro were created to open it, I don't see how it would be more convenient than one of those options. What am I missing?
Well, I wish it would be that simple. Unfortunately, the navigator does not stay in place. If a document is open with a navigator on, and you open another doc from it, it will also have an open nav (and vice-versa). What if you don't want a nav on that document? You have to go and close the sidebar. A macro helps automate this, it would run on document open event, and each document would have it's option to open or close the nav on opening.
cheers
Eliot
OpenOffice 4.1.3 on Windows 8, Leonovo laptop with 5GB ram and 1Ghz dual-core processor
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Macro to turn on the document navigator

Post by RoryOF »

How is the second document to know that you do not want the sidebar? You have to tell it. It may be easier to map the sidebar switch to a key and use that key to turn the sidebar on/off than have some interaction with the macro to tell it that it is to run or not run.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Macro to turn on the document navigator

Post by F3K Total »

Hello
eminkovitch wrote:It can't capture ...
I don't see a problem in doing that, just captured the F5 action:

Code: Select all

sub Navigator_on
    dim document   as object
    dim dispatcher as object
    dim args1(0) as new com.sun.star.beans.PropertyValue
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    args1(0).Name = "Navigator"
    args1(0).Value = true
    dispatcher.executeDispatch(document, ".uno:Navigator", "", 0, args1())
end sub

sub Navigator_off
    dim document   as object
    dim dispatcher as object
    dim args1(0) as new com.sun.star.beans.PropertyValue
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    args1(0).Name = "Navigator"
    args1(0).Value = false
    dispatcher.executeDispatch(document, ".uno:Navigator", "", 0, args1())
end sub
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
eminkovitch
Posts: 14
Joined: Sun Feb 19, 2017 4:59 am

Re: Macro to turn on the document navigator

Post by eminkovitch »

Thank you, that's exactly what I was looking for.
OpenOffice 4.1.3 on Windows 8, Leonovo laptop with 5GB ram and 1Ghz dual-core processor
Post Reply