Lingo Scripting Xtras

Lingo Xtras usually include several (perhaps many) new methods (custom Lingo functions).


All Lingo Xtras should support a mMessageList() method that displays a list of the other methods supported by the Xtra, and sometimes includes brief documentation.

Example 13-2 lists the methods within the NetLingo Xtra, which appear as built-in Lingo commands.

Example 13-2. The Output from NetLingo’s mMessageList()

put mMessageList (xtra "NetLingo ")
-- "xtra NetLingo
* netStatus * --
* getNetText  * --
* browserName * --
* tellStreamStatus * --

The NetLingo Xtra’s mMessageList lists only the method names, but no documentation. (See "Deciphering the mMessageList.”) You’ll often need to consult the separate documentation provided with the Xtra. (In this case, the NetLingo methods are described in the Lingo Dictionary, online Help, and Lingo pop-up menus.) Typing the mMessageList command is tedious. Add the utility in Example 13-3 to a movie script.

Example 13-3. Relief from mMessageList()

on xhelp xtraName
  if voidP(xtraName) then
    set xtraName = "FileIO"
  end if
  put mMessageList (xtra xtraName)
end xhelp

Xhelp() prints out the Help text for the specified Xtra or for the FileIO Xtra if none is specified.

xhelp "mui"

Deciphering the mMessageList

Most Lingo Xtra’s mMessageList method provides more information than does NetLingo’s. Here are excerpts from FileIO Xtra’s Help text.

Example 13-4. Deciphering FileIO mMessageList()

put mMessageList (xtra "FileIO")  -- or use the xhelp utility ...

Get Lingo in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.