{*******************************************************}
{                                                       }
{       Pascal Script Source File                       }
{       Run by RemObjects Pascal Script in CnWizards    }
{                                                       }
{       Generated by CnPack IDE Wizards                 }
{                                                       }
{*******************************************************}

program ActionShortCut;

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  CnWizUtils;

// This script shows how to get IDE Action Names and Set Action Shortcut.
  
var
  ActionList: TCustomActionList;
  I: Integer;
  Action: TContainedAction;

begin
  // Print All Action Names and Captions.
  ActionList := GetIDEActionList;

  for I := 0 to ActionList.ActionCount - 1 do
    if ActionList.Actions[I] is TCustomAction then
      Writeln(ActionList.Actions[I].ClassName + ' | ' + ActionList.Actions[I].Name +
        ' | ' + TCustomAction(ActionList.Actions[I]).Caption +
        ' | ' + ShortCutToText(TCustomAction(ActionList.Actions[I]).ShortCut))
    else
      Writeln(ActionList.Actions[I].ClassName + ' | ' + ActionList.Actions[I].Name);

  // Change shortcut of 'View AlignPalette' in View Menu.
  Action := FindIDEAction('ViewAlignPaletteCommand');
  if (Action <> nil) and (Action is TCustomAction) then
  begin
    TCustomAction(Action).ShortCut := TextToShortCut('Shift+Alt+A');
    Writeln('Now You can Show Align Palette by Pressing Shift+Alt+A.');
  end;
end.

 