Pressing keys programatically

Why reinvent the wheel when you can send keystrokes? for example, you can filter out marked rows or add a new visualization by sending keystrokes programatically

import clr

from System.Windows.Forms import SendKeys, Control, Keys

#Filter out Marked Rows same as 
SendKeys.Send("(^+M)") #Ctrl+M

#Create a Box Plot 
SendKeys.Send("^+{5}") #same as Ctrl+Shift+5

List of shortcuts

Ctrl+A Mark filtered rows. 
Ctrl+B Bookmarks.
Ctrl+C Copy the marked records to the clipboard as text.
Ctrl+D Duplicate active page.
Ctrl+E Unmark Resets the set of marked records. No records will be marked after you have executed this operation. 
Ctrl+F Find.
Ctrl+I Inverts the set of marked records. Marks all unmarked records and unmarks the set of marked records.
Ctrl+L or Alt+L Toggles legends of a visualization on or off.
Ctrl+M Filter to, Sets the selection to the marked records. Creates a temporary filter so that only the marked records are visible.  
Ctrl+N New Page.
Ctrl+O Open an existing file or a file to import.
Ctrl+P Print the active visualization. 
Ctrl+R Reset all filters.
Ctrl+S Save the present visualization in the same format as when opened.
Ctrl+T Create a new text area. 
Ctrl+U Duplicate visualization.
Ctrl+V Paste the clipboard contents into Spotfire. 
Ctrl+Y Redo. 
Ctrl+Z Undo.
Ctrl+W or Alt+F4 Close.
Ctrl+Shift+M Filter out 
Ctrl+1 Create a new table.  
Ctrl+2 Create a new cross table. 
Ctrl+3 Create a new bar chart. 
Ctrl+4 Create a new line chart. 
Ctrl+5 Create a new combination chart.  
Ctrl+6 Create a new pie chart. 
Ctrl+7 Create a new scatter plot. 
Ctrl+8 Create a new 3D scatter plot.
Ctrl+9 Create a new map chart.
Ctrl+0 Create a new graphical table. 
Ctrl+Shift+1 Create a new tree map. 
Ctrl+Shift+2 Create a new heat map. 
Ctrl+Shift+3 Create a new parallel Coordinate plot. 
Ctrl+Shift+4 Create a new summary table. 
Ctrl+Shift+5 Create a new box plot. 
F1 Help.
F12 Save file.
Alt+Enter or Ctrl+Enter Opens the Properties dialogue. 
Delete Deletes the set of marked records. 

No comments: