Handler Menu Tool MIAW
©06 Alex da Franca -- alex@farbflash.de
version 1.0 (07 April 2007)
  • Version 1.2.1:
    • fixed missing filtermask for bafilelist on windows
    • added support for tortoiseMerge to make diffs under windows too
    • added support for tortoiseMerge to make diffs under windows too
    • Removed the OSControl menu completely in favour of buddyMenu, as I today noticed, that I get a fatal error on windows, if the number of items in the menu is more than 65. So people will have to get the free buddyMenu xtra and mac users will need to live with the buddyMenu bug, which was the reason to provide OSC as an alternative. I am not even sure, if the issue went away with OSC
    • changed linebreak handling in compare to svn
    • enabled most of the bbedit function also for windows using user definad apps as relacements
    • fixed problems with compare scripts, when there were not enough permissions on mac osx
    • added functions for lingodoc snippets and fixed issues with external script editors on mac


  • Version 1.2:
    • fixed bug with windows version handling the shell xtra call incorrectly. I was calling shell_cmd_list, which doesn't exist in the windows version, as this is done by a parameter.

  • Version 1.1:
    • added identifier @@ to prevent parameter evaluation with value(). Instead each parameter entered into the MUI dialog which begins with "@@" will be treated as string in any case. This is useful for example for the commit message parameter in the dialog of the subversion commit functions, where you might not want the string being evaluated.

    • workaround for a director bug, where a miaw can't call a handler on the stage, which happens to appear in the same script. The handler in the same script will ALWAYS take precedence, although the statement is enclosed in a tell statement. The fix is that the handler with the tell statement now is in its own script and you can't call a handler which happens to have the exact same name as the one I am using to process the tell statement.

    • the handler menu is subdivided into one submenu per castlib now. So the list doesn't get that long as it used to, if you happen to have many scripts in your movie.

    • added custom utilities handler script. This is a template as strting point, if you wish to add your own built-in utilities handlers. Please share...

    • added new funcion for roundtrip bbedit. Edit in BBEdit now is a synchronous call and Director will "wait" until BBedit is done with the edit call. So you can edit a script in BBEdit, save it and the next line of lingo code reads the results back in. As this works only for one script, there is another new handler which is "Open in BBEdit". This allows to open more than one script at a time in BBEdit, edit it and save the changes. Back in Director (which was not paused this time to "wait" for BBEdits result), you call another new handler "Refresh members edited in BBEdit" to read the changed temporary files back in.

    • split up the utilities script into smaller single scripts for better handling. The utilities script was growing too big and so I decided to split the subversion functions and the BBEdit functions into their own scripts and inherit them the methods of the Utilities script by making it an ancestor.

  • Version 1.0:
    • added support for OSControl, as replacement for buddyMenu, due to a bug in buddyMenu (Occasionally Directors own menus got mixed up with buddyMenu Xtra menus).
      Version 1.0 now is built to use the OSControl xtra to draw the menu, but can easily be switched to fall back to buddyMenu. It is just a question of removing the OSControl members. Read more

    • added new Utilities handler: "mCopyConvert2HTML"
      I use this handler to convert the html from a textmember to html formatted via CSS in order to format my lingo scripts for the web.
      Basically it uses director text members to convert to html in the first place and this handler just converts directors html into CSS based html. This is simply nicer, than all these font tags.
      -- Usage: -- -- Copy the scripttext from a script editor window -- -- make a new #text member -- -- open the new #textmember in the text editor -- -- paste the contents of the clipboard (now the text member has the script text WITH the formatting, like color etc.) -- -- select the textmember in the castlib and use the handler "mCopyConvert2HTML" to get a CSS html string into your clipboard, ready to paste in your texteditor as html page. -- -- hold the option/control key in order to skip the html header, if you want to paste INTO an existing html document later.

    • added new Utilities handler: "mCompareSelectedScriptmembers"
      I use this handler to compare lingo scripts using bbedits bbdiff command line tool (sorry, this is mac-only for BBEdit users. I guess there are similar apps for Windows, so if anyone wants to contribute...).
      -- Usage: -- -- Select two or more scriptmembers in one castlib and choose "mCompareSelectedScriptmembers" -- -- Note that the total number selected script castmembers is divided by 2 and the first of the "first half" is compared to the first of the "second half", the second of the "first half" is compared to the second of the "second half" and so on. So if you select 10 members member 1 is compared to member 6, member 2 is compared to member 7, member 3 is compared to member 8, member 4 is compared to member 9 and member 5 is compared to member 10. So you can compare one block of members against another block of members. Usually I simply copy a block of scriptmembers in the old version and paste it temporarely into the castlib of the new version of a movie, then I select both blocks and compare. This will open the BBEdit results window and I can see the changes from one version to the other.
      Be aware of the fact, that this works with text and field members also.



  • Version 0.9: Initial version

  • Use this movie in your Director Xtras folder to list all handlernames of all scriptmembers in your director movie in a hierarchical menu.

    Unlike Directors own handler menu, this tool lists not only Moviescript handlers, but rather all three types of scripts:

    • Movie
    • Score
    • Parent

    The different types are subdivided into own submenus.

    Unlike Directors handlername menu the handlers are not listed all in one single menu, but they are categorized by the scriptmembers, they appear in.

    There's also a submenu which lists the scripts used by the sprites in the current frame. So you can quite easily send an event to a sprite on stage. Note, that the scriptlist is used, rather than the scriptinstancelist for two reasons: It exists, if the movie is not running and querying the scriptinstancelist of a sprite with an empty scriptinstancelist puppets the whole channel and makes it unresponsive furtheron. As the script goes through each sprite to build the list this could only be avoided using the D10 syntax "makeScriptedSprite". I decided to go with the scriptlist, which has the downside of not listing dynamically added behaviors, but hey... ;-)

    Another important difference is, that handlers get executed by default and only the use of a modifier key either shows the occurrence in the script editor (Option/Alt key) or copies the syntax into the clipboard (Shift key).

    So this tool provides an easy way of using your own scripts for authoring without needing to remember the names and type the same handlernames over and over again into the message window. It provides also a way to sendSprite() events, by simply selecting the event from the menu and entering the parameters in an upcoming dialog.

  • There is one version, which uses BuddyMenu Xtra from Gary Smith, the maker of many great Xtras, like for example the indispensable BuddyAPI Xtra. Get the latest version at: http://www.mods.com.au/BudMenu/index.htm

    The new version 1.0, uses the OSControl xtra as default to draw the menu, as BuddyMenu Xtra has a bug, which OSC appearantly hasn't. You need to own a license of OSControls Xtra (which I highly recommend anyway) in order to author the movie. Therefore there is a dcr version of the OSC version in case you have no OSC license, in which case, you can't edit the tool yourself. Get the latest version of OSControls Xtra at: http://xtras.openspark.com/index.php?page=OSC_home

  • In order to open the script editor and highlight the match (selecting a handlername in the menu while pressing the Option/Alt key) the UIHelper xtra (Windows: JavaUiHelper.x32) is required.
    The UIHelper Xtra is one of the standard Xtras, which were delivered with Director until version 8, as part of the 'save as java' xtra components.
    The UIHelper xtra is also in the standard-install of Director MX and MX2004. Director 8.5 is missing the xtra, but fortunately the UIHelper Xtra from version 8 works with 8.5 as well. If you use "HandlerMenu" with D 8.5, copy the UIHelper Xtra from previous versions over to your D 8.5 Xtras folder.
    Note: You need to have the java components installed in Director 8 for the UIHelper Xtra (Windows: JavaUiHelper.x32) to appear in your xtras folder. You'll find the installer on your D8 CD
    (Mac: run 'Install Java Components' from the rootlevel of the D8 CD;
    Windows: run setup.exe which is contained in the folder 'Java Components' on the root level of the D8 CD).

  • Some of the built-in "Utility" handlers also require Xtras. These are mostly the standard Xtras, but some handlers require Valentin Schmidts great Shell Xtra. Get it at: http://staff.dasdeck.de/valentin/xtras/shell/

  • Since this movie is an opensource project you can put your own Utility handlers into it, which may require other xtras.
  • Download and unstuff

  • Move the file "HandlerMenu.dir" to your Director Xtras folder. (Director application folder -> Configuration -> Xtras)

  • Restart Director and choose "HandlerMenu" from the "Xtras" menu
  • Quickly execute handlers which are found in the currently open stage movie from this menu.

  • Holding the Option (Mac) / Ctrl (windows) key pressed, while selecting a menu item opens the script and highlights the handler in the editor instead of executing the handler.

  • Holding the Shift key pressed copies the syntax into the clipboard instead of executing the handler. So you can paste it in the script you are currently working in.

  • Constrain the handlers which get listed in the "Handlers" menu using the search field. Now only handlers containing the string in the search field will be listed in the menu. If the search string starts with the reserved character "*" the search is executed as "match starts with chunk", if the search-string ends with "$" the search is executed as "match ends with chunk".

  • There is also a "Utilities" menu with some of my authoring helper handlers, which I frequently use, but don't have in the castlib of every movie, as I do not use them at runtime. So instead of adding the script to my movie, to have the handlers appear in the "Handlers" menu, I simply have some "built-in" functions. Instead of messing around with my scripts and changing the "Utilities" menu contents, it maybe easier to just add a scriptmember with your own helper handlers to your movie (maybe even only temporarely while authoring) in order to use these handlers from the "Handlers" menu. It's all up to your own liking.

  • Access and control both menus via the keyboard. Ctrl+TAB opens the "Utilities" menu and Ctrl+Shift+TAB opens the "Handlers" menu. It may take some milliseconds to register the key-events, as I don't get keyDown events in an inactive MIAW, so I poll them on a regular basis. This also means, that the menu appears even, if director is in the background :-( If you want to disable the keyboard-control just uncomment it in the framescript "keyboardNavigation_FrameLoop" (member(2,1)). Once the menu is showing you can use the cursor keys to navigate the menu and the RETURN key to execute.
  • IMPORTANT NOTE!
    This movie calls the sleep method of the UIHelper xtra on idle, as otherwise the CPU usage would permantly be very high and not only consume my powerbook battery power, but also heat the computer up and make the fan spin as if there is no tomorrow. In order to avoid that stupid behavior I spin the performance down making the engine release the cpu for 1 tick on mac (1/60 second) and 1 millisecond on a windows PC on every idle event. This impacts the playback speed of your movie too. So keep in mind, to close the tool miaw, if you make performance tests with your movie. Or, if you prefer, turn this feature of by simply commenting the line in the "on idle" handler in the first movie script.
  • If you want to add your own built-in handlers, add them to the parentscript "alexUtilities" and add the handlernames to the behaviorscript "simpleBMMenu" (resp. in the new OSControls version in the script "OSCmenu_Utilities") in the first handler, just like the already existing handlers. There are two things to keep in mind:

  • 1.) the parameters are parsed form the menu string, so add the required parameters to the string, which appears in the menu, just like the other menu items.

  • 2.) the parentscript is executed from within the scope of the stage movie. So every member and other script you refer to in your Utility handler istaken form the castlibs of the stage movie rather than form the castlibs of this movie.

  • If you like this movie you may also want to take a look at my modification of the Start Page.dxr movie, in order to auto-open the last opened document and also auto-open your favorite Athoring Tool Miaws, like for example "Handlernames", 3DPI, Handlerlist (which is basically the same as this, only as treeview list), Scenelist or FindAll ...etc (I made some other tool miaws, which you can check out here)

  • If you prefer to use buddyMenu xtra (which is buggy, but free) over OSControl xtra (you need a license to use it in authoring) simply replace the OSControl menu member with another member. You can use the member "OSControlReplacement".
    Select sprite 2 and 3 in the score window, then select member "OSControlReplacement" in the cast window and select:
    "Edit -> Exchange Cast Members" (or press Cmd + E).
    You can delete the OSControl member "oscontrolMenu" afterwards.
    From that time on the buddyMenu xtra is used to draw the menu instead of the OSControl xtra.
    the only difference in the script is in script "OSCmenu_Utilities" and "OSCmenu_Handlers": if sprite(me.spritenum).member.type = #OSmenu then ...

Help:

In case you may want to support my work via paypal donation... PayPal...