Automatically open Data Viewer?

The first thing I do when I open Filemaker is open the data viewer. Every time. And most of the time I got to the "Watch" tab.

Is there some way in code, or with Monkey Brain or something else to make it "just open automatically". It's a little thing but it's a few times every day for me.

on mac, I'm sure you could customize your keyboard shortcuts and assign a shortcut to that menu item. So not automatically, but perhaps even better, because the shortcut should let you toggle the dataviewer visibility.

3 Likes

that's a darn good idea...

On the Mac, in Keyboard Maestro, you can create a macro to open the Data Viewer window with an Application Trigger, being when the FileMaker app launches.

You can also set up multiple triggers for a macro, so you could also set a hot key trigger for it, too, so you can open and close the window manually.

Keyboard Maestro is quite powerful and you can set up If/Then logic.

Personally, I have set a hot key trigger of ⌃D to open both the Data Viewer and Script Debugger windows before debugging a script. But if the front window title contains "Manage Database", then the macro instead clicks the Duplicate button when a field is selected.

You can set up conditions for a macro to do its logic, like if a button is enabled, or if a menu item exists, or is marked, or does not exist, or exists but is not marked.

1 Like

Agree 100% with this. Keyboard Maestro is the way to go to automate your FM dev environment. It has been a very long time since I have played with it, but MacroExpress Pro on windows is a similar product. It was less intuitive than KM on the Mac, but maybe is better now.

Keyboard Maestro is a fantastic app. Here is a macro to set up some watch defaults.

Debug Data Viewer Defaults.zip (4.9 KB)

watch-default

1 Like

Nice. I just used the built in Keyboard / App Shortcuts to set it. It can't do the "whenever Filemaker is opened" trick, but it's good enough.

I keep hearing good things about keyboard maestro and better touch tool. I'll need to look into that some day. Right now my focus is on Typinator, for something different altogether.

Typinator is great! It's a great time saver!
Some time ago I downloaded a Typinator set with many shortcuts for FileMaker script steps. I think from filemakerstandards.org. It is not yet back on the newly relaunched site.

Since I have FileMaker set to German language, I translated the set to German. Also the shortcuts. If and case conditions and others nicely laid out with indentations.

If anyone is interested, I could share it: EN and DE

1 Like

Please do share!

Here's the English Typinator Set that I got some time ago:
FileMakerCode_EN.tyset.zip (31,9 KB)

The German Set I have to clean a bit first. It is still evolving.

Thanks. I just grabbed a copy of Typinator. I've tried Keyboard Maestro a couple of times in the past and it just seems like more overhead for such a small gain. The built in preferences in MacOS does most of what I need so not sure if I'll stick with Typinator, but appreciate the heads up. I'd never heard of it.

I'm glad I can help (if so?). I don't find much time to participate here.
I hope you don't spend too much time with 3 Party-Tools such as Keyboard Maestro, when a solution is already there with MBS.
MBS-PlugIn Functions (as I use as a Script to be prompted via cmd & 1 / cmd & 2 / etc.)

Open Debugger:
set Var [ $r ; Value: MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( "Menubar.RunMenuCommand" ; 49260 )" ) ]

Open DataViewer:
… MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( "Menubar.RunMenuCommand" ; 49297 )" )

Open CustomFunction Window:
… MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( "Menubar.RunMenuCommand" ; 51191 )" )

There seem to be a code (51191 - cf-Window, 49297 - DataViewer for example) for every Menu option of FM.

5 Likes

This is awesome, but I think your quotes got messed up in your example. I couldn't get your examples to work, but the following worked for me when I took out the delay:

Open CustomFunction Window:

Open Debugger:
set Var [ $r ; Value: MBS ( "Menubar.RunMenuCommand" ; 49260 ) ]

Open DataViewer:
MBS ( "Menubar.RunMenuCommand" ; 49297 )

Open CustomFunction Window:
MBS ( "Menubar.RunMenuCommand" ; 51191 )

So I just added it to my startup script keyed to my user. Woot!

PS: In terms of triggering menu items, if you're on Mac you don't need typinator or anything fancy, that's been built into MacOS (OSX) since day one in the keyboard preferences. I use it to reassign quick keys for apps often. For example I have command-B to be "bold" and command-shift-b to be "Browse Mode".

check my file:
Shortcuts.fmp12.zip (625.9 KB)

Yeah the second quotes (around Menubar.RunMenuCommand) need escapes:

This is the code in your example file:

MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( "Menubar.RunMenuCommand" ; 49260 )" )

I just removed the delay and it worked also.

Thanks again for this, EXACTLY what I was hoping for and it works like a charm!

Using this delay is according to a recommendation by @MonkeybreadSoftware.
If it works on your 64-core 5,6GHz M2 Mac without the delay doesn't mean it works on your customers macs
:wink:

The delay is there, because some menu commands don't run while a script runs. So delaying for 0.1 second lets FileMaker finish the script step and then run the menu command after it.

1 Like

OK I figured out the confusion. FMsoup uses \ as escape as does Filemaker so if you copy some filemaker code that has \ and " then only the quotes are displayed so you have to wrap the "code" in the code tag when posting it here for it to be correct... :slight_smile:

Open Debugger:
MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( \"Menubar.RunMenuCommand\" ; 49260 )" )

Open DataViewer:
MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( \"Menubar.RunMenuCommand\" ; 49297 )" )

Open CustomFunction Window:
MBS ( "Schedule.EvaluateAfterDelay" ; .01 ; "MBS ( \"Menubar.RunMenuCommand\" ; 51191 )" )

Thanks for clarifying!

1 Like

This is exactly what I've done. I have a shortcut to open the Data Viewer, and another for the Script Debugger. Makes it super easy to turn them on and off.