# Automatically open Data Viewer?

**URL:** <https://the.fmsoup.org/t/automatically-open-data-viewer/3128>\
**Category:** Questions\
**Created:** [October 4, 2022, 4:04pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128 "2022-10-04T16:04:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 4, 2022, 4:04pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/1 "2022-10-04T16:04:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bobino](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bobino/32/194_2.png) [@Bobino](https://the.fmsoup.org/u/Bobino)\
**Post date:** [October 4, 2022, 8:15pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/2 "2022-10-04T20:15:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 4, 2022, 8:52pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/3 "2022-10-04T20:52:01Z")

</div>

that's a darn good idea...

---

<div class="post-metadata">

**Author:** ![soup2nuts](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@soup2nuts](https://the.fmsoup.org/u/soup2nuts)\
**Post date:** [October 5, 2022, 1:51pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/4 "2022-10-05T13:51:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bowdendata](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@bowdendata](https://the.fmsoup.org/u/bowdendata)\
**Post date:** [October 5, 2022, 2:59pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/5 "2022-10-05T14:59:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rivet](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/rivet/32/1727_2.png) [@rivet](https://the.fmsoup.org/u/rivet)\
**Post date:** [October 5, 2022, 3:04pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/6 "2022-10-05T15:04:41Z")

</div>

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

[Debug Data Viewer Defaults.zip](https://the.fmsoup.org/uploads/short-url/6S60EJxi51ljAnnLJ3HniBAjbtU.zip) (4.9 KB)

![watch-default](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/8/847da6349297bfba7539a90c251364bb10d6cb2b.jpeg)

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 5, 2022, 6:33pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/7 "2022-10-05T18:33:32Z")

</div>

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_.

---

<div class="post-metadata">

**Author:** ![Bobino](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bobino/32/194_2.png) [@Bobino](https://the.fmsoup.org/u/Bobino)\
**Post date:** [October 6, 2022, 5:59am UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/8 "2022-10-06T05:59:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [October 6, 2022, 9:05am UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/9 "2022-10-06T09:05:35Z")

</div>

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](http://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

---

<div class="post-metadata">

**Author:** ![Bobino](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bobino/32/194_2.png) [@Bobino](https://the.fmsoup.org/u/Bobino)\
**Post date:** [October 6, 2022, 1:40pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/10 "2022-10-06T13:40:40Z")

</div>

> [@mipiano](#):
>
> If anyone is interested, I could share it: EN and DE

Please do share!

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [October 6, 2022, 2:05pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/11 "2022-10-06T14:05:50Z")

</div>

Here's the English Typinator Set that I got some time ago:  
[FileMakerCode\_EN.tyset.zip](https://the.fmsoup.org/uploads/short-url/7p7Mg8gACsKMtXPNS3DT39vCuj5.zip) (31,9 KB)

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

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 6, 2022, 2:48pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/12 "2022-10-06T14:48:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EfficientBizz](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/efficientbizz/32/252_2.png) [@EfficientBizz](https://the.fmsoup.org/u/EfficientBizz)\
**Post date:** [October 13, 2022, 7:27am UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/13 "2022-10-13T07:27:17Z")

</div>

> [@JasonMark](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 13, 2022, 12:47pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/14 "2022-10-13T12:47:34Z")

</div>

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".

---

<div class="post-metadata">

**Author:** ![EfficientBizz](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/efficientbizz/32/252_2.png) [@EfficientBizz](https://the.fmsoup.org/u/EfficientBizz)\
**Post date:** [October 13, 2022, 1:40pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/15 "2022-10-13T13:40:11Z")

</div>

check my file:  
[Shortcuts.fmp12.zip](https://the.fmsoup.org/uploads/short-url/dfgnsDnJ76s2YvHopLzg0tCUmVf.zip) (625.9 KB)

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 13, 2022, 1:58pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/16 "2022-10-13T13:58:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![EfficientBizz](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/efficientbizz/32/252_2.png) [@EfficientBizz](https://the.fmsoup.org/u/EfficientBizz)\
**Post date:** [October 13, 2022, 2:28pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/17 "2022-10-13T14:28:56Z")

</div>

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  
😉

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [October 13, 2022, 2:44pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/18 "2022-10-13T14:44:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)\
**Post date:** [October 13, 2022, 3:02pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/19 "2022-10-13T15:02:39Z")

</div>

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... 🙂

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!

---

<div class="post-metadata">

**Author:** ![ByteTheBullet](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@ByteTheBullet](https://the.fmsoup.org/u/ByteTheBullet)\
**Post date:** [October 17, 2022, 7:12pm UTC](https://the.fmsoup.org/t/automatically-open-data-viewer/3128/20 "2022-10-17T19:12:17Z")

</div>

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.

[Next page](https://the.fmsoup.org/t/automatically-open-data-viewer/3128.md?page=2)
