API changes in comparison to the macro language

Far Manager Macro System

API changes in comparison to the macro language


  1. All identifiers are case sensitive.
  2. Instead of directly specifying the keys you use function Keys.
  3. $AKey –> Keys("AKey")
  4. $SelWord –> Keys("SelWord")
  5. $XLat –> Keys("XLat")
  6. $Exit –> exit()
  7. Logical properties have type boolean (so it does not make sense to compare them with the number 0).
  8. Function prompt can return either a string or a false (but never a number 0).
  9. Many functions are placed in the table mf (abbreviation from macrofunctions), e.g.: mf.abs, mf.fsplit, etc.
  10. Functions Far.Window_Scroll, mf.beep, mf.fexist and Panel.SetPath return a boolean rather than a number.
  11. Functions mload and msave have changed, see their descriptions.
  12. Context dependent properties are placed in the table Object, e.g.: Object.CurPos, Object.Empty.
  13. CheckHotkey -> Object.CheckHotkey
  14. GetHotkey -> Object.GetHotkey
  15. Logical properties for testing execution areas are in table Area, e.g.: Area.Editor, Area.Shell.
  16. Macro.Area -> Area.Current.
  17. Dialog.AutoCompletion -> Area.DialogAutoCompletion
  18. Shell.AutoCompletion -> Area.ShellAutoCompletion
  19. CallPlugin –> Plugin.Call. This call is always asynchronous. For synchronous calls use Plugin.SyncCall.
  20. Functions Plugin.Exist, Plugin.Menu, Plugin.Config and Plugin.Command return a boolean value.
  21. mmode(3,x) no more affects synchronicity/asynchronicity of calls to plugins; it does nothing and returns 0.
  22. Dlg.Info.Id -> Dlg.Id
  23. Dlg.Info.Owner -> Dlg.Owner
  24. Far.Cfg.Get -> Far.Cfg_Get. This function returns a string in case of success and false in case of failure.
  25. Far.Cfg.Err does not exist anymore.
  26. FullScreen -> Far.FullScreen
  27. IsUserAdmin -> Far.IsUserAdmin
  28. History.Disable -> Far.DisableHistory
  29. KbdLayout -> Far.KbdLayout
  30. KeyBar.Show -> Far.KeyBar_Show
  31. Window.Scroll -> Far.Window_Scroll
  32. Menu.Info.Id -> Menu.Id
  33. MsX, MsY, MsButton, MsCtrlState, MsEventFlags — see table Mouse
  34. RCounter does not exist anymore.
  35. Macro.Const, Macro.Func, Macro.Keyword и Macro.Var do not exist anymore.
  36. Macro specification: flag DisableOutput does not exist; screen redraw is disabled by default; added flag EnableOutput (apply it if screen redraw is needed during macro execution).
  37. Macro specification: flags Selection and NoSelection are no more applicable for editor/viewer/dialog areas. For these areas one should use respectively EVSelection and NoEVSelection flags.
  38. Macro specification: flag RunAfterFARStart is in effect also when Far Manager is run with /e or /v command line switch. In those cases only macros whose area field contains respectively Editor or Viewer are run.

See also: Restrictions in the use of some functions