Skip to content

SuperMacro - Examples#

Open Windows Explorer then go to C:\Program Files
Output delay should be set to ~20ms
{{win}{e}}{{pause:400}}{{alt}{d}}c:\Program Files\{{enter}}
Open Notepad and change settings
Output delay should be set to ~20ms
This will not work correctly if your Windows (and notepad) are not in English
{{win}{r}}{{pause:500}}notepad.exe{{enter}}{{pause:1000}}Ok... Let's see what this plugin can do...{{alt}{f}}{{right}}{{PAUSE:400}}{{right}}  {{PAUSE:400}}f{{pause:400}}times{{down}}{{PAUSE:400}}{{tab}}{{PAUSE:400}}{{down}}{{PAUSE:400}}{{down}}{{PAUSE:400}}{{ENTER}}{{ENTER}}For more information visit: https://barider.g1thubio{{ctrl}{shift}{left}}{{PAUSE:400}}https://barraider.github.io{{ENTER}}{{alt}{o}}f{{PAUSE:100}}Lucida Console{{tab}}Regular{{Tab}}12{{ENTER}}
Calculate something using the Windows Calculator
Output delay should be set to ~20ms
{{win}{r}}{{pause:300}}calc{{enter}}{{pause:1000}}1*2*3*4*5=
Move the mouse to a certain position on the screen, then Double-Click the left mouse button
To find the correct position you can use the Mouse Location action.
{{MOUSEXY:1000,15}}{{MLEFTDBLCLICK}}
Move the mouse by 10 pixels left and 20 pixels down on every press
{{MOUSEMOVE:-10,20}}
Add comments in the code using `{{//}}` command
  INPUT:myNumber // User inputs number.
  FUNC:MUL:MyResult:$myNumber:10 // Multiply number by 10
  OUTPUTTOFILE:MyResult:c:\temp\result.txt // Save result in file
Read text from a file and show it on the Stream Deck Key
{{VARSETFROMFILE:MyVar:c:\counter.txt}}
{{SETKEYTITLE:$MyVar}}
Read text from a clipboard and show it on the Stream Deck Key
{{VARSETFROMCLIPBOARD:MyVar}}
{{SETKEYTITLE:$MyVar}}
Scroll the mouse up by 5 clicks and then down by 3 clicks
{{MSCROLLUP:5}}
{{MSCROLLDOWN:3}}
Move the mouse to coordinates set from variables
{{VARSET:X:100}}
{{VARSET:Y:400}}
{{MOUSEXY:$X,$Y}}
Replace all "l"'s with "Z"'s in the string `Hello World` and show it on key
{{VARSET:XX:Hello World}}
{{VARSET:A:l}}
{{VARSET:B:Z}}
{{FUNC:REPLACE:MyVar:$XX:$A:$B}}
{{SETKEYTITLE:$MyVar}}
Show the current date and time on the key
{{FUNC:NOW:MyVar:yyyy-MM-dd HH:mm:ss}}
{{SETKEYTITLE:$MyVar}}
Print the current date and time
{{FUNC:NOW:MyVar:yyyy-MM-dd HH:mm:ss}}
{{OUTPUT:MyVar}}
Set value of variable into the clipboard
{{VARSET:MyVar:Hello World}}
{{SETCLIPBOARD:$MyVar}}
Read text from one txt file and insert into another along with a timestamp. (Contributed by Bowser#2891)
{{VarSetFromFile:ListVar:C:\temp\List.txt}}
{{VarSetFromFile:NewTextVar:C:\temp\NewText.txt}}
{{FUNC:NOW:TimeVar:yyyy-MM-dd HH:mm:ss}}

{{FUNC:CONCAT:ListVarU:$ListVar:$SMENTER:$NewTextVar: :$TimeVar}}

{{OutputToFile:ListVarU:C:\temp\List.txt}}
Get input from user, then load a file with the inputted name (from the `c:\temp` folder) to CLIPBOARD and show it on the Stream Deck Key. (Contributed by Bowser#2891)
Note: Entire content of file may not fit within the screen of the Stream Deck Key.
{{Input:MyVar}}
{{FUNC:CONCAT:Filename:C:$SMCOLON:\temp\:$MyVar:.txt}}
{{VarSetFromFile:MyVar2:$Filename}}
{{SetClipboard:$MyVar2}}
{{SETKEYTITLE:$MyVar2}}
Click the mouse while a key is held (in this example we will simulate a shift click)
{{KeyDown:LSHIFT}}{{LBUTTON}}{{KeyUp:LSHIFT}}

Variables#

Variables: Get input from user and then use it later on
{{INPUT:Name}}Hello {{OUTPUT:Name}}, Nice to meet you!
Variables: Read text from file into MyVar variable
{{VarSetFromFile:MyVar:C:\filename.txt}}

Functions#

Functions: Choose a random number between 1 (inclusive) to 10 (exclusive) and store it in MyVar
{{FUNC:RANDOM:MyVar:1:10}}
Functions: Input 2 numbers from the user. Choose a random number between firstNum variable (inclusive) to secondNum variable (exclusive) and store it in MyVar
{{INPUT:firstNum}}
{{INPUT:secondNum}}
{{FUNC:RANDOM:MyVar:$firstNum:$secondNum}}
Functions: Select a number from the user and multiply it by 10. Then save it to a file named c:\\temp\\result.txt
{{INPUT:myNumber}}
{{FUNC:MUL:MyResult:$myNumber:10}}
{{OUTPUTTOFILE:MyResult:c:\temp\result.txt}}