Show/Hide Formatting Bar

Note: A special thanks to Jason DeLooze for sharing this technique, which neatly remedies a small, but vexing, annoyance.

Demo file: Show-Hide-Formatting-Bar.zip

6-13-2014 10-04-55 PM

Have you ever wanted to have a script toggle the Formatting Bar on/off in browse mode? If so, you will discover that FileMaker does not provide a “Show/Hide Formatting Bar” script step.

In FileMaker 12 and 13, the closest you will get to that script step is this one…

6-13-2014 10-32-50 PM

“Allow Formatting Bar” is a very odd script step, because “on” enables the ability to display the Formatting Bar, but (unless you know the trick, which we’ll get to shortly) does not actually display the bar itself.

6-14-2014 12-13-30 AM

Meanwhile “off” both disables the ability to display the Formatting Bar, and if the bar is currently visible, hides it as well.

6-14-2014 12-13-31 AM

There are two seemingly-identical demo files in today’s download:

  • Formatting Bar – Non-working
  • Formatting Bar – Works

…and as you might expect, the buttons work in the second second demo, but not in the first.

6-14-2014 1-03-04 AM

Incidentally, I could have attached the buttons to scripts, but in the interest of simplicity instead attached them directly to the “Allow Formatting Bar” action, like so:

6-14-2014 9-22-55 AM

Here are the steps to enable the buttons to show/hide the formatting bar:

  1. Make a copy of the “non-working” version of the demo — let’s call it simply “Formatting Bar”
  2. Open “Formatting Bar” — the file must be local, not hosted.
  3. In browse mode, click the “Formatting Bar: On” button
  4. While still in browse mode, choose “Formatting Bar” from the “View” menu, and at this point, the Formatting Bar should be visible.6-14-2014 9-47-04 AM
  5. Go into layout mode.
  6. From the View menu, and choose “Formatting Bar” from the “View” menu. (Yes, you already did this in browse mode, but you need to also do it in layout mode.)
  7. Make some minor change to the layout, for example, select the buttons and move them up a point or two.
  8. Return to browse mode, and if the following dialog appears, click “Save”
    6-14-2014 10-17-08 AM
  9. Now click the two buttons in browse mode, and observe that they show and hide the Formatting Bar… and henceforth the “Allow Formatting Bar” script step will behave the same way.

One potential problem with this technique: if, when the Formatting Bar is visible, your clever user disables it via the View menu, the buttons will stop working until the file has been closed and then re-opened, at which point the buttons will again function as desired.

To prevent the clever user from causing this mischief, use a custom menu set to remove the “Formatting Bar” entry from the View menu.

7 thoughts on “Show/Hide Formatting Bar

  1. Stuart Lawson

    This doesn’t work when the file is hosted on a server.
    If your platform is OS X, the following Applescript script set will work:

    tell application “FileMaker Pro Advanced”
    activate
    tell application “System Events”
    tell process “FileMaker Pro Advanced”
    try
    click menu item “Formatting Bar” of menu 1 of menu bar item “View” of menu bar 1
    end try
    end tell
    end tell
    end tell

    Reply
  2. Derek C

    Hello!
    Thanks for taking the time to write this up. It is exactly what I have been looking for!

    I have followed these instructions to implement this hack into my own solution, however I cannot get this to work after I close the window and/or the file. Essentially, it does not persist on my solution as it does with the sample files you have included here.

    Is there something I might be doing wrong? Or perhaps this hack doesn’t work quite the same in FMPro Advanced 14? I followed the instructions provided enough times that you could call me insane (doing the same thing over and over, expecting different results) lol.

    Thanks in advance for any help you may be able to provide.

    Reply
  3. Edward L Scott

    After inheriting an existing host based solution for support/further-development, the customer wanted the Formatting Bar to be ON by default since she had to turn it on every time she used the file. When attempting to use this method while the file was hosted, it did not work. Moving the file locally, performing the method on the local file then worked for the local file, and then re-uploading the local version back to the server (replacing the non-working version) caused it to work for the hosted file too!

    Yay!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s