Axaptapedia is now maintained by AgileCadence For more information please click here.

Difference between revisions of "Editor scripts"

From Axaptapedia
Jump to: navigation, search
m
Line 1: Line 1:
=== Usage ===
+
=== Use ===
  
 
Editor scripts are the short programs for automating tasks in the Axapta [[code editor]].
 
Editor scripts are the short programs for automating tasks in the Axapta [[code editor]].
Line 32: Line 32:
 
}
 
}
 
</xpp>
 
</xpp>
 +
 +
=== Links ===
 +
[[Editor_scripts_OpenInAOT]] - a good script that is added into the addIns submenu. Opens the selected object and its properties.

Revision as of 09:52, 1 December 2006

Use

Editor scripts are the short programs for automating tasks in the Axapta code editor.

Scripts can be called via:

  • Pressing Alt+M and selecting scripts in menu
  • Calling context menu in the editor (Scripts submenu)
  • Pressing the Scripts button in the editor toolbar

Autohotkey macros can be used to assign hotkeys to Editor Scripts

Development

The Scripts menu is constructed from the structure EditorScripts class using the following rules:

  • each method which takes a single argument with the type Editor class is an editor script
  • if the method name contains an underscore (_) it is placed under a submenu with the same name as the part of the method name before the underscore. For example, \Classes\EditorScripts\template_method_parm becomes menu item "parm" in "method" submenu under "template" submenu in the scripts menu.

Example

This script adds item "context" to the Scripts menu. This item shows standard Add-ins menu. <xpp> void context(Editor _e) {

 SysContextMenuTreeNode toolsMenu=
     SysContextMenuTreeNode::newPath(_e.path());
 PopupMenu popupMenu = toolsMenu.buildMenu(InfoLog.hWnd());
 int x, y;
 ;
 [x, y] = WinAPI::getCursorPos();
 toolsMenu.runMenu(popupMenu.draw(x, y), toolsMenu, _e);

} </xpp>

Links

Editor_scripts_OpenInAOT - a good script that is added into the addIns submenu. Opens the selected object and its properties.