;-Begin-----------------------------------------------------------------
;-
;- Program to enable new or classic editor design in transaction SE80
;-
;-----------------------------------------------------------------------

  ;-Global variables----------------------------------------------------
    Dim $WinTitle = "[CLASS:SAP_FRONTEND_SESSION]"
    Dim $UserSpecSets = "[TITLE:User-Specific Settings; CLASS:#32770]"

  ;-Procedure SetWindow-------------------------------------------------
    Func SetWindow($Title, $Max)
      WinActivate($Title)
      WinSetState($Title, "", @SW_SHOW)
      If $Max Then
        WinSetState($Title, "", @SW_MAXIMIZE)
      EndIf  
    EndFunc
  
  ;-Procedure SwitchEditorDesign----------------------------------------
    Func SwitchEditorDesign()

      SetWindow($WinTitle, 1)

      ;-Start tooltip---------------------------------------------------
        ToolTip("Switch the Front-End Editor to another design", _
          @DesktopWidth / 2 - 100, @DesktopHeight / 2 - 50, _
          "Switch editor design")
        Sleep(4000)

      ;-Open utilities menu---------------------------------------------
        Send("!u")
        ToolTip("Type Alt+u or choose the Utilities menu", 300, 45, _
          "Use Utilities menu")
        Sleep(4000)
        ToolTip("")
        Sleep(500)

      ;-Choose setting entry--------------------------------------------
        Send("{DOWN}")
        ToolTip("Type n or choose the Settings menu entry", 300, 45, _
          "Use Settings menu")
        Sleep(4000)

        ;-Disable tooltip-----------------------------------------------
          ToolTip("")
          Sleep(32)

        Send("n")
  
      SetWindow($UserSpecSets, 0)
  
      ;-Choose editor style---------------------------------------------
        ToolTip("Choose the editor style you want", 210, 270, "Choose")
        Sleep(4000)

        Send("{DOWN}")
        Sleep(400)
        Send("{DOWN}")
        Sleep(400)
        Send("{DOWN}")
        Sleep(400)
        Send("{DOWN}")

        ;-Disable tooltip-----------------------------------------------
          ToolTip("")
          Sleep(750)

        Send("{ENTER}")
      
      ;-End tooltip-----------------------------------------------------
        ToolTip("Now you have another design", _
          @DesktopWidth / 2 - 100, @DesktopHeight / 2 - 50, _
          "Switch editor design")
        Sleep(4000)

    EndFunc

  ;-Main----------------------------------------------------------------
    SwitchEditorDesign()

;-End-------------------------------------------------------------------