March 9, 201312 yr I've used FM10 for years but just recently (finally) got FM12. With custom menus, I can attach my own script, easy. So I attach to the "close window" command my own "close window check" script. Easy. And I attach to the "find mode" command my own "enter find mode" script. Easy. Now, within any other scripts, if there's a "close window" script step, the "close window check" script is triggered because it's set to do that within my custom menu. This is a pain but you can get around that in various ways. I used global variables to turn on and off "script triggers". But what I don't get is: Within any other scripts, if there's a "enter find mode" script step, the "enter find mode" script is NOT triggered. Why does a script with a "close window" script step call my custom script attached to the "close window" menu item, but a script with a "enter find mode" script step (and actually "perform find" as well) doesn't trigger any of my custom menu scripts?
March 9, 201312 yr Custom menu scripts usually only run when a user initiates them, not by script. Are you sure it's the custom menu that's triggered? There is another place to set a Close Window script...in the File-->File Options-->Script Triggers dialog.
March 10, 201312 yr Author Awwww... smart cookie! Yeh I originally set the close window trigger in the file options. Right... so scripts only fire from file / layout / field triggers, but not from custom menus. That's interesting because it would appear to me that using file / layout triggers is far more problematic than using custom menu scripts. Having a script fire every time a script calls "close window" seems crazy but it's easily solved by just attaching your "close window" script to a custom menu. I can't see any reason why anyone would want to use file / layout / mode change triggers if there's a corresponding menu item for it.
Create an account or sign in to comment