Script showing all keycommands

Hi

Mbncp made a great script back in 2005 for Cubase SX3 showing all used key commands in a color html-table.

Has anyone succeeded transforming the script to win7 and cubase 6 ?

Or can anybody help

I have changed the path but I get an error saying : "the file wasn’t found ".
line 81 letter 3

The Script was :


Option Explicit 
Const HTML = True ' True html file, False texte file (Tab delimited) 
Const SECTIONNAME = False ' add the section name (True or False) 
Const SORTKEY = False ' sort by key name (True or False) 
' TODO : to have your keys in a certain order, enter them here: 
'----------------------------------------------- 
  B = Array( _ 
    "F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12", _ 
    "`","1","2","3","4","5","6","7","8","9","0", _ 
    "-","=","_","+","Backspace", _ 
    "A","B","C","D","E","F","G","H","I","J","K","L", "M", _ 
    "N","O","P","Q","R","S","T","U","V","W","X","Y","Z", _ 
    "[", "]","\",";","'",",",".","/","Return","Space", _ 
    "Insert", "Del", "Home", "End", "PgUp", "PgDown",  _ 
    "Left Arrow", "Up Arrow", "Right Arrow", "Down Arrow", _ 
    "Pad0","Pad1","Pad2","Pad3","Pad4","Pad5","Pad6","Pad7", _ 
    "Pad8","Pad9","Pad .","Pad /","Pad *","Pad -","Pad +","Enter" _ 
    ) ' end of array 
  ' Make sure you have SORTKEY = False ;) 
  Const REMOVE_UNUSED = false ' removes unused keys from the list 
  ' Find Replace key name , add always by pair: "SX key name", "New Name" 
  C = Array("_", "Shift+-", "+", "Shift+=") 
  ' C = Array(-1) ' uncomment if you don't want key renaming 
  ' Section color (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/colors/colors.asp) 
  ' Each section name must be followed by a color name 
BK = Array( "Mixer",            "linen", _ 
            "Preferences",      "silver", _ 
            "Edit",             "red", _ 
            "Devices",          "white", _ 
            "Media",            "white", _ 
            "MIDI Quantize",    "steelblue", _ 
            "Set Insert Length","skyblue", _ 
            "Play Order",       "white", _ 
            "Transport",        "yellow", _ 
            "Zoom",             "lightyellow", _ 
            "Nudge",            "yellow", _ 
            "Scores Statusbar", "white", _ 
            "Score Functions",  "white", _ 
            "Tool",             "white", _ 
            "File",             "indianred", _ 
            "Project",          "white", _ 
            "AddTrack",         "white", _ 
            "Editors",          "white", _ 
            "Inspector",        "white", _ 
            "Audio",            "white", _ 
            "Hitpoints",        "white", _ 
            "Audio Realtime Processing",   "white", _ 
            "MIDI",             "turquoise", _ 
            "Navigate",         "white", _ 
            "Import",           "limegreen", _ 
            "Export",           "deeppink", _ 
            "Process",          "lightskyblue", _ 
            "Process Plugin",   "mediumturquoise", _ 
            "Analyze",          "gold", _ 
            "Process Logical Preset",  "white",_ 
            "Scores",           "white", _ 
            "Score Symbol Palettes", "white", _ 
            "Score Align Elements",  "white",_ 
            "Score Meter Scale", "white", _ 
            "Workspaces",        "lightyellow", _ 
            "Macro",             "white" _ 
            ) 
CH = Array("Aring" ,197,"aring" ,229,"auml" ,228,"ouml" ,246,"uuml" ,252,"szlig" ,223,"Oslash" ,216, "oslash" ,248,"Auml" ,196,"Ouml" ,214,"Uuml" ,220,"nbsp" ,160,"Agrave" ,192,"Egrave" ,200,"Eacute" ,201,"Ecirc" ,202,"egrave" ,232,"eacute" ,233,"ecirc" ,234,"agrave" ,224,"iuml" ,239,"ugrave" ,249,"ucirc" ,251,"uuml" ,252,"ccedil" ,231,"AElig" ,198,"aelig" ,330, "OElig" ,338,"oelig" ,339,"euro" ,8364,"laquo" ,171,"raquo" ,187, "sect", 167) 
' / TODO 
'--------------------------------------------------- 
Dim A, B, C, BK, CH 
GetSX_Keys 
Sub GetSX_Keys 
  Dim WshShell, fso, f, f2, f3, dir, dir2, tp, bc, n 
  Redim A(UBound(B)+1) 
  For f = 0 To UBound(B) 
    A(f+1) = Array( B(f), ".", ".", ".", ".", ".", ".", ".", ".") 
  Next 
  A(0) = Array("key", "-", "Shift", "Ctrl", "Alt", "Ctrl+Shift", "Alt+Shift", "Ctrl+Alt", "Ctrl+Alt+Shift") 
  If HTML Then tp = "html" else tp = "txt" 
  set WshShell = CreateObject("WScript.Shell") 
  dir = WshShell.SpecialFolders("C:\Users\Bruger\AppData") & "C:\Program Files\Steinberg\Cubase 6\" 
  Set fso = CreateObject("Scripting.FileSystemObject") 
  Set f = fso.CreateTextFile(dir & "Key Commands 2." & tp, True) 
  Set f2 = fso.CreateTextFile(dir & "KC_TMP.xml", True) 
  Set f3 = fso.OpenTextFile(dir & "Key Commands.xml", 1) 

  dim xmlDoc, t, u, v, w, x, y, z, s, d 
  set xmlDoc = CreateObject("Microsoft.XMLDOM")
  dir2 = replace(dir , "\", "/")  
  xmlDoc.validateOnParse = False 
  xmlDoc.resolveExternals = False 
  xmlDoc.async = False 

  ' special foreign chars    
  f2.write "<!DOCTYPE characters [ <!ELEMENT characters (character*) > <!ELEMENT character (#PCDATA ) > " 
  For n = 0 To UBound(CH) 
   f2.Write "<!ENTITY " & CH(n) & " " & chr(34) & "&#" & CH(n+1) & ";" & chr(34) & " >" 
   n = n+1 
  Next    
  f2.write "] > " 
  f2.write vbCRLF 
  f2.write(f3.ReadAll()) 
  f2.Close 
  f3.Close 
  xmlDoc.load(dir2 & "KC_TMP.xml") 
  If xmlDoc.parseError.errorCode Then 
    MsgBox _ 
    "File: " & dir & "Key Commands.xml" &vbCrLf & _ 
    "Line : " & xmlDoc.parseError.line & vbCrLf & _ 
    "Error: " & xmlDoc.parseError.reason, 0, "XML parser error:" 
'     Exit Sub 
  End If  
  On error resume next 
  for each t in xmlDoc.childNodes 
    If s = "Macro" Then Exit For 
    for each u in t.childNodes 
      If s = "Macro" Then Exit For 
      for each v in u.childNodes 
        If s = "Macro" Then Exit For 
        for each w in v.childNodes 
          If w.nodename = "string" Then s = w.attributes.item(1).text 
          If s = "Process Plugin" Then bc = True Else bc = False 
          If s = "Macro" Then Exit For 
          for each x in w.childNodes 
            If x.childNodes.length = 2 Then 
              d = x.childNodes.item(0).attributes.item(1).text 
              If bc Then 
                If len(d) > 34 Then d = Mid(d, 35) 
              End If  
              If x.childNodes.item(1).childNodes.length > 1 Then 
                for each y in x.childnodes.item(1).childNodes 
                  AddKey s, d , y.attributes.item(0).text 
                next 
              Else  
                AddKey s, d , x.childNodes.item(1).attributes.item(1).text 
              End If 
            End If 
          next 
        next  
      next 
    next  
  next 
  If HTML then 
    f.write "<TABLE cellSpacing=1 cellPadding=1 width=" & _ 
     chr(34) & "99%" & chr(34) & "align=center border=1>" & vbCrLf 
  End If 
  If SORTKEY Then 
    For t = 1 To UBound(A) 
      For u = t+1 To UBound(A) 
       If UCase(A(u)(0)) < UCase(A(t)(0)) Then 
         z = A(t) : A(t) = A(u) : A(u) = z 
       End If 
     Next  
    Next 
  End If  
  For t = 0 To UBound(A) 
    If HTML Then f.write "<TR>" 
    If REMOVE_UNUSED Then 
      For B = 1 To UBound(A(t)) 
        If A(t)(B) <> "." Then Exit For        
      Next 
      If B > UBound(A(t)) Then 
        Redim b(-1) : A(t) = b 
      End If  
    End If 
    For u = 0 To UBound(A(t)) 
      If HTML Then 
        If t = 0 Or u = 0 Then 
          f.write "<TD align=middle style=" & chr(34) & "FONT-WEIGHT: bold" & Chr(34) & ">" & A(t)(u) & "</TD>" 
        Else 
          If A(t)(u) = "." Then 
            'f.write "<TD align=middle>" & A(t)(u) & "</TD>" 
            f.write "<TD align=middle>.</TD>" 
          Else  
            f.write "<TD align=middle style=" & chr(34) & "BACKGROUND-COLOR: " & A(t)(u) & "</TD>" 
          End If  
        End If  
      Else 
        f.write A(t)(u) 
        If u <> UBound(A(t)) Then f.write vbTab 
      End If 
    Next 
    If HTML Then f.write "</TR>" 
    f.write vbCrLf 
  Next 
  If HTML then f.write "</TABLE>" & vbCrLf 
  f.close 
  If HTML Then s = "Explorer.exe " Else s = "notepad.exe " 
  WshShell.Run s & dir & "Key Commands 2." & tp 
End Sub 
Sub AddKey(s, d, byval k) 
  dim bp, ak, n, kn, bkc, m, ks 
  k = Trim(k) 
  If IsArray(C) Then 
    For n = 0 To UBound(C) Step 2 
      If C(n) = k Then 
        k = C(n+1) 
        Exit for 
      End If  
    Next 
  End If 
  ks = k 
  If Right(k, 1) = "+" Then bp = True 
  k = Replace(k, "+", vbCr) 
  If bp Then k = Left(k, len(k)-1) & "+" 
  ak = Split(k, vbCr) : kn = 0 
  For n = 0 To UBound(ak)-1 
    Select Case UCase(ak(n)) 
      Case "SHIFT" 
        kn = kn Or 1 
      Case "CTRL" 
        kn = kn Or 2 
      Case "ALT" 
        kn = kn Or 4 
    End Select 
  Next 
  For n = 1 To UBound(A) 
    If UCase(A(n)(0)) = UCase(ak(UBound(ak))) Then Exit For 
  Next 
  If n > UBOund(A) Then 
    Redim Preserve A(n) 
    A(n) = Array(ak(UBound(ak)), ".", ".", ".", ".", ".", ".", ".", ".") 
  End If 
  Select Case kn 
    Case 4: 
      kn = 3 
    Case 3: 
      kn = 4 
  End Select 
  If HTML Then 
    bkc = "white" 
    If IsArray(BK) Then 
      For m = 0 To UBound(BK) Step 2 
        If BK(m) = s Then 
          bkc = BK(m+1) 
          Exit For 
        End If 
      Next 
    End If 
  End If  
  If SECTIONNAME Then 
    A(n)(kn+1) = bkc &  A(0)(kn) & ">" & s & "-" & d 
  Else 
    A(n)(kn+1) = bkc & chr(34) & " title=" & chr(34) & "[ " & s & " ]  " & ks & "  : " & d & chr(34) & ">" & d 
  End If 
End Sub

You have a line with:

 dir = WshShell.SpecialFolders("C:\Users\Bruger\AppData") & "C:\Program Files\Steinberg\Cubase 6\"

Replace it with this:

dir = WshShell.SpecialFolders("AppData") & "\Steinberg\Cubase 6\"

And it ought to work.

:slight_smile:

By the way, I realize that the rest of my script is somewhat modified and to my eyes is a little easier on the eyes with Verdana as the font instead of Times New Roman and stuff like that. I also made a little frame.

In addition to that I experimented a little too much with the collors of all the backgrounds in the “spread sheet” haha! It looks OK where it used to be in another file but with the original commands and all that it’s just painful.

But I post it here anyway if somebody thinks it’s useful. If you know a little HTML and CSS you can figure out where the hex colors are and change it to your own liking. Here is the script anyway:

' TODO: Set the different Const and Arrays to your needs 
' --------------------------------------------------- 
Option Explicit 
Const theFONTSIZE = 11
Const HTML = True ' True html file, False texte file (Tab delimited) 
Const SECTIONNAME = False ' add the section name (True or False) 
Const SORTKEY = False ' sort by key name (True or False) 
' TODO : to have your keys in a certain order, enter them here: 
'----------------------------------------------- 

    ' not available on a swedish keyboard      
  B = Array( _ 
    "F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12", _ 
    "1","2","3","4","5","6","7","8","9","0", _ 
    "A","B","C","D","E","F","G","H","I","J","K","L", "M", _ 
    "N","O","P","Q","R","S","T","U","V","W","X","Y","Z","Å","Ä","Ö", _ 
    "<", ">", "§", "ESC", "?", "*", _
    "-","=", _ 
    "Left Arrow", "Up Arrow", "Right Arrow", "Down Arrow", _ 
    "Backspace", "Del", "Insert","Home", "End", "PgUp", "PgDown", "Scroll", "Pause", _ 
    "'",",",".",";","Return","Space", _ 
    "Pad .","Pad /","Pad *","Pad -","Pad +","Enter", _ 
    "Pad0","Pad1","Pad2","Pad3","Pad4","Pad5","Pad6","Pad7","Pad8","Pad9", _
    "[", "]","\","/","_","+","`" _
    ) ' end of array 
  ' Make sure you have SORTKEY = False ;) 
  Const REMOVE_UNUSED = False ' removes unused keys from the list 
  ' Find Replace key name , add always by pair: "SX key name", "New Name" 
  C = Array("_", "Shift+-", "+", "Shift+=") 
  ' C = Array(-1) ' uncomment if you don't want key renaming 
  ' Section color (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/colors/colors.asp) 
  ' Each section name must be followed by a color name 
BK = Array( "Mixer",            "linen", _
            "Preferences",      "silver", _
            "Edit",             "red", _
            "Devices",          "white", _
            "Media",            "white", _
            "MIDI Quantize",    "steelblue", _
            "Set Insert Length","skyblue", _
            "Play Order",       "white", _
            "Transport",        "yellow", _
            "Zoom",             "lightyellow", _
            "Nudge",            "yellow", _
            "Scores Statusbar", "white", _
            "Score Functions",  "white", _
            "Tool",             "white", _
            "File",             "indianred", _
            "Project",          "white", _
            "AddTrack",         "white", _
            "Editors",          "white", _
            "Inspector",        "white", _
            "Audio",            "white", _
            "Hitpoints",        "white", _
            "Audio Realtime Processing",   "white", _
            "MIDI",             "turquoise", _
            "Navigate",         "white", _
            "Import",           "limegreen", _
            "Export",           "deeppink", _
            "Process",          "lightskyblue", _
            "Process Plugin",   "mediumturquoise", _
            "Analyze",          "gold", _
            "Process Logical Preset",  "white",_
            "Scores",           "white", _
            "Score Symbol Palettes", "white", _
            "Score Align Elements",  "white",_
            "Score Meter Scale", "white", _
            "Workspaces",        "lightyellow", _
            "Macro",             "white" _
            )                                   
  CH = Array("nbsp",         		 	160, _
            "Auml",          		 	196, _
            "Aring",             	197, _
            "Agrave",         		192, _
            "AElig" ,         		198, _
            "laquo" ,         		171, _
            "raquo" ,         		187, _
            "Egrave",         		200, _
            "Eacute",          		201, _
            "Ecirc" ,         		202, _
            "Ouml",         		 	214, _
            "Uuml",         		 	220, _
            "szlig",         		 	223, _
            "auml",               228, _
            "aring",              229, _
            "ccedil" ,         		231, _
            "egrave" ,         		232, _
            "eacute" ,         		233, _
            "ecirc" ,         		234, _
            "agrave" ,         		224, _
            "iuml" ,         		 	239, _
            "ouml",         		 	246, _
            "ugrave" ,         		249, _  	
            "ucirc" ,             251, _
            "uuml" ,         		 	252, _
            "uuml",         		 	252,_ 
            "aelig" ,         		330, _
            "OElig" ,         		338, _
            "oelig" ,         		339, _
            "euro" ,         		 	8364, _
            "sect",          		 167) 
' / TODO 
'--------------------------------------------------- 
Dim A, B, C, BK, CH 
GetSX_Keys 
Sub GetSX_Keys 

  Dim WshShell, fso, f, f2, f3, dir, dir2, tp, bc, n, fs

  Redim A(UBound(B)+1) 
  For f = 0 To UBound(B) 
    A(f+1) = Array( B(f), ".", ".", ".", ".", ".", ".", ".", ".") 
  Next 
  A(0) = Array("key", "-","Ctrl","Shift" ,"Ctrl+Shift","Alt","Ctrl+Alt","Shift+Alt","Ctrl+Alt+Shift") 
  If HTML Then tp = "html" else tp = "txt" 
  set WshShell = CreateObject("WScript.Shell") 
  dir = WshShell.SpecialFolders("AppData") & "\Steinberg\Cubase 6\" 
  Set fso = CreateObject("Scripting.FileSystemObject") 
  Set f = fso.CreateTextFile(dir & "KeyCommandsViewer." & tp, True) 
  Set f2 = fso.CreateTextFile(dir & "KC_TMP.xml", True) 
  Set f3 = fso.OpenTextFile(dir & "Key Commands.xml", 1) 

  dim xmlDoc, t, u, v, w, x, y, z, s, d 
  set xmlDoc = CreateObject("Microsoft.XMLDOM") 
  dir2 = replace(dir , "\", "/")  
  xmlDoc.validateOnParse = False 
  xmlDoc.resolveExternals = False 
  xmlDoc.async = False 

  ' special foreign chars    
  f2.write "<!DOCTYPE characters [ <!ELEMENT characters (character*) > <!ELEMENT character (#PCDATA ) > " 
  For n = 0 To UBound(CH) 
   f2.Write "<!ENTITY " & CH(n) & " " & chr(34) & "&#" & CH(n+1) & ";" & chr(34) & " >" 
   n = n+1 
  Next    
  f2.write "] > " 
  f2.write vbCRLF 
  f2.write(f3.ReadAll()) 
  f2.Close 
  f3.Close 
  xmlDoc.load(dir2 & "KC_TMP.xml") 
  If xmlDoc.parseError.errorCode Then 
    MsgBox _ 
    "File: " & dir & "Key Commands.xml" &vbCrLf & _ 
    "Line : " & xmlDoc.parseError.line & vbCrLf & _ 
    "Error: " & xmlDoc.parseError.reason, 0, "XML parser error:" 
'     Exit Sub 
  End If  
  On error resume next 
  for each t in xmlDoc.childNodes 
    If s = "Macro" Then Exit For 
    for each u in t.childNodes 
      If s = "Macro" Then Exit For 
      for each v in u.childNodes 
        If s = "Macro" Then Exit For 
        for each w in v.childNodes 
          If w.nodename = "string" Then s = w.attributes.item(1).text 
          If s = "Process Plugin" Then bc = True Else bc = False 
          If s = "Macro" Then Exit For 
          for each x in w.childNodes 
            If x.childNodes.length = 2 Then 
              d = x.childNodes.item(0).attributes.item(1).text 
              If bc Then 
                If len(d) > 34 Then d = Mid(d, 35) 
              End If  
              If x.childNodes.item(1).childNodes.length > 1 Then 
                for each y in x.childnodes.item(1).childNodes 
                  AddKey s, d , y.attributes.item(0).text 
                next 
              Else  
                AddKey s, d , x.childNodes.item(1).attributes.item(1).text 
              End If 
            End If 
          next 
        next  
      next 
    next  
  next 

 If HTML then

    f.write "  "& vbCRLF & "" _
   & "  "& vbCRLF & "" _
   & "<html>" & vbCRLF & "" _
   & "<head>" & vbCRLF & "" _
   & "	<title>Cubase 5 Key Commands</title>" & vbCRLF & "" _
   & "	<style type='text/css'>" & vbCRLF & "" _
   & "  table#keycommands{font-size: "& theFONTSIZE &";font-family:Verdana}"& vbCRLF & "" _
   & "	</style>" & vbCRLF & "" _
   & "</head>" & vbCRLF & "" _
   & "<body TEXT='#000000' BGcolor='#445566' font size="& theFONTSIZE &">" & vbCRLF & "" _
   & "<TABLE id='keycommands' cellSpacing=0 cellPadding=0 width='99%' align=center border=0>"  
  End If  
  If SORTKEY Then 
    For t = 1 To UBound(A) 
      For u = t+1 To UBound(A) 
       If UCase(A(u)(0)) < UCase(A(t)(0)) Then 
         z = A(t) : A(t) = A(u) : A(u) = z 
       End If 
     Next  
    Next 
  End If  
  For t = 0 To UBound(A) 
    If HTML Then f.write "<TR>" 
    If REMOVE_UNUSED Then 
      For B = 1 To UBound(A(t)) 
        If A(t)(B) <> "." Then Exit For        
      Next 
      If B > UBound(A(t)) Then 
        Redim b(-1) : A(t) = b 
      End If  
    End If 
    For u = 0 To UBound(A(t)) 
      If HTML Then
        If t = 0 Or u = 0 Then
		'values for columns and rows
         f.write "<TD align=middle style=" & chr(34) & "FONT-WEIGHT: bold" & Chr(34) & " bgcolor='#223344'><font face='verdana' color='white'>" & A(t)(u) & "</TD>" & vbCRLF & ""
        Else
          If A(t)(u) = "." Then
            'f.write "<TD align=middle >" & A(t)(u) & "</TD>" & vbCRLF & ""
		' if there is no command asigned
            f.write "<TD align=middle >- - -</TD>" & vbCRLF & ""
          Else 
            f.write "<TD font face='verdana' align=middle style=" & chr(34) & "BACKGROUND-COLOR: " & A(t)(u) & "</TD>" & vbCRLF & ""
          End If 
        End If 
      Else
	        f.write A(t)(u)
        If u <> UBound(A(t)) Then f.write vbTab
      End If 
    Next 
    If HTML Then f.write "</TR>" & vbCRLF & "" 
    f.write vbCrLf 
  Next 
  If HTML then f.write "</TABLE>" & vbCrLf 
  f.close 
  If HTML Then s = "Explorer.exe " Else s = "notepad.exe " 
  WshShell.Run s & dir & "KeyCommandsViewer." & tp 
End Sub 
Sub AddKey(s, d, byval k) 
  dim bp, ak, n, kn, bkc, m, ks 
  k = Trim(k) 
  If IsArray(C) Then 
    For n = 0 To UBound(C) Step 2 
      If C(n) = k Then 
        k = C(n+1) 
        Exit for 
      End If  
    Next 
  End If 
  ks = k 
  If Right(k, 1) = "+" Then bp = True 
  k = Replace(k, "+", vbCr) 
  If bp Then k = Left(k, len(k)-1) & "+" 
  ak = Split(k, vbCr) : kn = 0 
  For n = 0 To UBound(ak)-1 
    Select Case UCase(ak(n)) 
      Case "SHIFT" 
        kn = kn Or 1 
      Case "CTRL" 
        kn = kn Or 2 
      Case "ALT" 
        kn = kn Or 4 
    End Select 
  Next 
  For n = 1 To UBound(A) 
    If UCase(A(n)(0)) = UCase(ak(UBound(ak))) Then Exit For 
 Next 
  If n > UBOund(A) Then 
    Redim Preserve A(n) 
    A(n) = Array(ak(UBound(ak)), ".", ".", ".", ".", ".", ".", ".", ".") 
  End If 
  Select Case kn 
    Case 1: ' Shift 
      kn = 2 
    Case 2: ' Ctrl 
      kn = 1 
    Case 3: ' Ctrl+Shift 
      kn = 3 
    Case 4: ' Alt 
      kn = 4 
    Case 5: ' Alt+Shift (4+1) 
      kn = 6 
    Case 6: ' Ctrl+Alt (4+2) 
      kn = 5 
    Case 7  ' Ctrl+Alt+Shift (2+4+1) 
      kn = 7 
       ' A(0) = Array("key", "-","Ctrl","Shift" ,"Ctrl+Shift","Alt","Ctrl+Alt","Shift+Alt","Ctrl+Alt+Shift") 
  End Select 
  If HTML Then 
    bkc = "white" 
    If IsArray(BK) Then 
      For m = 0 To UBound(BK) Step 2 
        If BK(m) = s Then 
          bkc = BK(m+1) 
          Exit For 
        End If 
      Next 
    End If 
  End If  
  If SECTIONNAME Then 
    A(n)(kn+1) = bkc &  A(0)(kn) & ">" & s & "-" & d 
  Else 
    A(n)(kn+1) = bkc & chr(34) & " title=" & chr(34) & "[ " & s & " ]  " & ks & "  : " & d & chr(34) & ">" & d 
  End If 
End Sub

And thanx again to mbncp whatever that means and where ever you are! I’ve worn that script down a few times over so it’s great that it’s just a file that we can reload instead of a printed paper! :smiley:

For anybody who wants to try this:

Use a text editor (Notepad on PC is just fine)
Cut and paste the script into Notepad.
Save the file as a Visual Basic file (e.g “myKeyCommands.vbs”)
The location should be the same as where the Cubase preferences are stored
C:\Documents and Settings[-insert your username-]\AppData\Roaming\Steinberg\Cubase 6
When you have the VBS file saved there you double click it and it will create and open a webpage.
This is a HTML file called “Key Commands 2.html” or in my script I see I’ve changed it in two places so it’s “KeyCommandsViewer.html”.
In any case there will be an new HTML file in your folder and that’s where you can view all the current Key Commands.
The are read by the VB script from the file called KeyCommands.xml in that same folder.
Now if you from within Cubase update your Key Commands and double click again the new data is updated as well.

THE HTML FILE WILL NOT UPDATE ITSELF SO YOU NEED TO RUN THE VBS FILE EVERY NOW AND THEN!

Or at least when you have made changes in the Key Commands, of course!
To avoid digging this deep into the computer just to view the KCs in Cubase the best thing to do is to create a shortcut to the myKeyCommands.vsb file and your HTML file and put them were they’re easy to find.
You might like the desktop but I have them on the start menu. Whatever works!

It should be a pretty straight forward process but computers are computers! :smiley:

oops! I see that my script is adjusted for Swedish QWERTY-keyboards … :blush:
You can cut and paste from both scripts and adjust to wherever you’re from!

PS looks great on a 27" monitor with one line per command and no linebreaks :sunglasses:

Hallelujah! I’ve been heard! :smiley:
Thank you, guys! To all of you!
This script is a great time saviour!
Thanks a lot!

Hi HowlingUlf thank you for your answer. I managed to eleminate the errors changing the path . I also tried your script. But I only get a html. document with a table with all the possibillities showing no short cuts. The script also open my document folder.

Can you help telling me what is wrong ?


Hans H

Okie dokie!
I’ve been away for a few days, stuck in the middle of nowhere, but it was nice! :smiley:
Back on track!

Here is the original script again, almost as Mbncp wrote it. It works like the original and it should perform what’s it designed to do? But you never know with computers …
This means the keyboard layout is now back to English QWERTY.

Two difference though:
I updated the list of colors to reflect Cubase 6 commands since some of them are new and some of them have changed name e.g “arranger track”.
I also set only the “Edit”, “File” and “Transport” commands to light colored backgrounds, and the rest have your usual hex #FFFFFF white background. Everybody’s different when it comes to colors so anybody can google how to change hex colors, unless you know already. Easy but tedious! You can of course set it back to what it used to be with verbose color names like “red” “green” “blue” etc

I hope this works. Let’s see what error message you get this time … :wink:

Option Explicit
Const HTML = True ' True html file, False texte file (Tab delimited)
Const SECTIONNAME = False ' add the section name (True or False)
Const SORTKEY = False ' sort by key name (True or False)
' TODO : to have your keys in a certain order, enter them here:
'-----------------------------------------------
  B = Array( _
    "F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12", _
    "`","1","2","3","4","5","6","7","8","9","0", _
    "-","=","_","+","Backspace", _
    "A","B","C","D","E","F","G","H","I","J","K","L", "M", _
    "N","O","P","Q","R","S","T","U","V","W","X","Y","Z", _
    "[", "]","\",";","'",",",".","/","Return","Space", _
    "Insert", "Del", "Home", "End", "PgUp", "PgDown",  _
    "Left Arrow", "Up Arrow", "Right Arrow", "Down Arrow", _
    "Pad0","Pad1","Pad2","Pad3","Pad4","Pad5","Pad6","Pad7", _
    "Pad8","Pad9","Pad .","Pad /","Pad *","Pad -","Pad +","Enter" _
    ) ' end of array
  ' Make sure you have SORTKEY = False ;)
  Const REMOVE_UNUSED = false ' removes unused keys from the list
  ' Find Replace key name , add always by pair: "SX key name", "New Name"
  C = Array("_", "Shift+-", "+", "Shift+=")
  ' C = Array(-1) ' uncomment if you don't want key renaming
  ' Section color (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/colors/colors.asp)
  ' Each section name must be followed by a color name
BK = Array("Add Track",                        "#FFFFFF", _    
"Analyze",                          "#FFFFFF", _
"Arranger",                         "#FFFFFF", _
"Audio",                            "#FFFFFF", _
"Audio Export",                     "#FFFFFF", _
"Audio Realtime Processing",        "#FFFFFF", _
"Automation",                       "#FFFFFF", _
"Beat Designer",                    "#FFFFFF", _
"Control Room",                     "#FFFFFF", _
"Devices",                          "#FFFFFF", _
"Edit",                             "#FFAAAA", _
"Editors",                          "#FFFFFF", _
"Export",                           "#FFFFFF", _
"File",                             "#AAAAFF", _
"Focus",                            "#FFFFFF", _
"Hitpoints",                        "#FFFFFF", _
"Import",                           "#FFFFFF", _
"Inspector",                        "#FFFFFF", _
"Macro",                            "#FFFFFF", _
"Media",                            "#FFFFFF", _
"MIDI",                             "#FFFFFF", _
"Mixer",                            "#FFFFFF", _
"Navigate",                         "#FFFFFF", _
"Note Expression",                  "#FFFFFF", _
"Nudge",                            "#FFFFFF", _
"Preferences",                      "#FFFFFF", _
"Preset",                           "#FFFFFF", _
"Process",                          "#FFFFFF", _
"Process Logical Preset",           "#FFFFFF", _
"Process Plugins",                  "#FFFFFF", _
"Process Project Logical Editor",   "#FFFFFF", _
"Project",                          "#FFFFFF", _
"Quantize",                         "#FFFFFF", _
"Sample Editor",                    "#FFFFFF", _
"Score Align Elements",             "#FFFFFF", _
"Score Functions",                  "#FFFFFF", _
"Score Meter Scale",                "#FFFFFF", _
"Score Symbol Palettes",            "#FFFFFF", _
"Scores",                           "#FFFFFF", _
"Scores Status Bar",                "#FFFFFF", _
"Set Insert Length",                "#FFFFFF", _
"Tool",                             "#FFFFFF", _
"Transport",                        "#AAFFAA", _
"Windows",                          "#FFFFFF", _
"Workspaces",                       "#FFFFFF", _
"Zoom",                        			"#FFFFFF" _
)
CH = Array("Aring" ,197,"aring" ,229,"auml" ,228,"ouml" ,246,"uuml" ,252,"szlig" ,223,"Oslash" ,216, "oslash" ,248,"Auml" ,196,"Ouml" ,214,"Uuml" ,220,"nbsp" ,160,"Agrave" ,192,"Egrave" ,200,"Eacute" ,201,"Ecirc" ,202,"egrave" ,232,"eacute" ,233,"ecirc" ,234,"agrave" ,224,"iuml" ,239,"ugrave" ,249,"ucirc" ,251,"uuml" ,252,"ccedil" ,231,"AElig" ,198,"aelig" ,330, "OElig" ,338,"oelig" ,339,"euro" ,8364,"laquo" ,171,"raquo" ,187, "sect", 167)
' / TODO
'---------------------------------------------------
Dim A, B, C, BK, CH
GetSX_Keys
Sub GetSX_Keys
  Dim WshShell, fso, f, f2, f3, dir, dir2, tp, bc, n
  Redim A(UBound(B)+1)
  For f = 0 To UBound(B)
    A(f+1) = Array( B(f), ".", ".", ".", ".", ".", ".", ".", ".")
  Next
  A(0) = Array("key", "-", "Shift", "Ctrl", "Alt", "Ctrl+Shift", "Alt+Shift", "Ctrl+Alt", "Ctrl+Alt+Shift")
  If HTML Then tp = "html" else tp = "txt"
  set WshShell = CreateObject("WScript.Shell")
 	dir = WshShell.SpecialFolders("AppData") & "\Steinberg\Cubase 6\"   
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.CreateTextFile(dir & "Key Commands 2." & tp, True)
  Set f2 = fso.CreateTextFile(dir & "KC_TMP.xml", True)
  Set f3 = fso.OpenTextFile(dir & "Key Commands.xml", 1)

  dim xmlDoc, t, u, v, w, x, y, z, s, d
  set xmlDoc = CreateObject("Microsoft.XMLDOM")
  dir2 = replace(dir , "\", "/") 
  xmlDoc.validateOnParse = False
  xmlDoc.resolveExternals = False
  xmlDoc.async = False

  ' special foreign chars   
  f2.write "<!DOCTYPE characters [ <!ELEMENT characters (character*) > <!ELEMENT character (#PCDATA ) > "
  For n = 0 To UBound(CH)
   f2.Write "<!ENTITY " & CH(n) & " " & chr(34) & "&#" & CH(n+1) & ";" & chr(34) & " >"
   n = n+1
  Next   
  f2.write "] > "
  f2.write vbCRLF
  f2.write(f3.ReadAll())
  f2.Close
  f3.Close
  xmlDoc.load(dir2 & "KC_TMP.xml")
  If xmlDoc.parseError.errorCode Then
    MsgBox _
    "File: " & dir & "Key Commands.xml" &vbCrLf & _
    "Line : " & xmlDoc.parseError.line & vbCrLf & _
    "Error: " & xmlDoc.parseError.reason, 0, "XML parser error:"
'     Exit Sub
  End If 
  On error resume next
  for each t in xmlDoc.childNodes
    If s = "Macro" Then Exit For
    for each u in t.childNodes
      If s = "Macro" Then Exit For
      for each v in u.childNodes
        If s = "Macro" Then Exit For
        for each w in v.childNodes
          If w.nodename = "string" Then s = w.attributes.item(1).text
          If s = "Process Plugin" Then bc = True Else bc = False
          If s = "Macro" Then Exit For
          for each x in w.childNodes
            If x.childNodes.length = 2 Then
              d = x.childNodes.item(0).attributes.item(1).text
              If bc Then
                If len(d) > 34 Then d = Mid(d, 35)
              End If 
              If x.childNodes.item(1).childNodes.length > 1 Then
                for each y in x.childnodes.item(1).childNodes
                  AddKey s, d , y.attributes.item(0).text
                next
              Else 
                AddKey s, d , x.childNodes.item(1).attributes.item(1).text
              End If
            End If
          next
        next 
      next
    next 
  next
  If HTML then
    f.write "<TABLE cellSpacing=1 cellPadding=1 width=" & _
     chr(34) & "99%" & chr(34) & "align=center border=1>" & vbCrLf
  End If
  If SORTKEY Then
    For t = 1 To UBound(A)
      For u = t+1 To UBound(A)
       If UCase(A(u)(0)) < UCase(A(t)(0)) Then
         z = A(t) : A(t) = A(u) : A(u) = z
       End If
     Next 
    Next
  End If 
  For t = 0 To UBound(A)
    If HTML Then f.write "<TR>"
    If REMOVE_UNUSED Then
      For B = 1 To UBound(A(t))
        If A(t)(B) <> "." Then Exit For       
      Next
      If B > UBound(A(t)) Then
        Redim b(-1) : A(t) = b
      End If 
    End If
    For u = 0 To UBound(A(t))
      If HTML Then
        If t = 0 Or u = 0 Then
          f.write "<TD align=middle style=" & chr(34) & "FONT-WEIGHT: bold" & Chr(34) & ">" & A(t)(u) & "</TD>"
        Else
          If A(t)(u) = "." Then
            'f.write "<TD align=middle>" & A(t)(u) & "</TD>"
            f.write "<TD align=middle>.</TD>"
          Else 
            f.write "<TD align=middle style=" & chr(34) & "BACKGROUND-COLOR: " & A(t)(u) & "</TD>"
          End If 
        End If 
      Else
        f.write A(t)(u)
        If u <> UBound(A(t)) Then f.write vbTab
      End If
    Next
    If HTML Then f.write "</TR>"
    f.write vbCrLf
  Next
  If HTML then f.write "</TABLE>" & vbCrLf
  f.close
  If HTML Then s = "Explorer.exe " Else s = "notepad.exe "
  WshShell.Run s & dir & "Key Commands 2." & tp
End Sub
Sub AddKey(s, d, byval k)
  dim bp, ak, n, kn, bkc, m, ks
  k = Trim(k)
  If IsArray(C) Then
    For n = 0 To UBound(C) Step 2
      If C(n) = k Then
        k = C(n+1)
        Exit for
      End If 
    Next
  End If
  ks = k
  If Right(k, 1) = "+" Then bp = True
  k = Replace(k, "+", vbCr)
  If bp Then k = Left(k, len(k)-1) & "+"
  ak = Split(k, vbCr) : kn = 0
  For n = 0 To UBound(ak)-1
    Select Case UCase(ak(n))
      Case "SHIFT"
        kn = kn Or 1
      Case "CTRL"
        kn = kn Or 2
      Case "ALT"
        kn = kn Or 4
    End Select
  Next
  For n = 1 To UBound(A)
    If UCase(A(n)(0)) = UCase(ak(UBound(ak))) Then Exit For
  Next
  If n > UBOund(A) Then
    Redim Preserve A(n)
    A(n) = Array(ak(UBound(ak)), ".", ".", ".", ".", ".", ".", ".", ".")
  End If
  Select Case kn
    Case 4:
      kn = 3
    Case 3:
      kn = 4
  End Select
  If HTML Then
    bkc = "white"
    If IsArray(BK) Then
      For m = 0 To UBound(BK) Step 2
        If BK(m) = s Then
          bkc = BK(m+1)
          Exit For
        End If
      Next
    End If
  End If 
  If SECTIONNAME Then
    A(n)(kn+1) = bkc &  A(0)(kn) & ">" & s & "-" & d
  Else
    A(n)(kn+1) = bkc & chr(34) & " title=" & chr(34) & "[ " & s & " ]  " & ks & "  : " & d & chr(34) & ">" & d
  End If
End Sub

Hi,

Thanks for that script.

I had to replace ‘Cubase 6’ with ‘Cubase 6_64’ on line 89 - cause my folder name is different.

Also, I’ve got a different version of this HTML file on my old XP machine which shows the functions on the left (in categories) and then the keys on the right, whereas this one does the keys on the left. Does anyone have this script handy?

Mike.

Thank you so much. Changing cubase 6 to cubase 6_64 and then it works. Very Nice :smiley:

Niiice! :sunglasses:

A really nice one, thumbs up!

Does anybody know how to include the shortcuts for macros in that?

Thanks a lot, Matze!

IIRC I think Mbncp said he went to great lengths to get the macros out because they … couldn’t behave or whatever!

Check the lines following these ones and you’ll see that somebody really didn’t want anything macro in there:

for each t in xmlDoc.childNodes
    If s = "Macro" Then Exit For 
      blah blah blah

I know nothing about VBS but it seems human enough to poke around in without causing major errors. :slight_smile:
Would be great if somebody could fix this because the macros need to be there of course!