O'Reilly logo

Lingo in a Nutshell by Bruce A. Epstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lingo Scripting Xtras

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

Tip

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required