-
-
Notifications
You must be signed in to change notification settings - Fork 2
Macros.ini File Configuration
Macros.ini is a file located in %localappdata%\PowerToysMacros\
that defines Macros to be used. They can be executed using macro:MacroName optional additional data here
in PowerToys Run.
[MacroName]
Type=
Verb=
Data=
RunAfter=
Type | Description | Added | Modified |
---|---|---|---|
Command | Executes a Command defined in Data , the same as Win+R
|
0.1.0.0 | 0.3.0.0 |
RawText | Inputs Plaintext defined in Data
|
0.2.0.0 | - |
SpecialText | Inputs Formatted Text defined in Data
|
0.2.0.0 | - |
Verb | Description | Added | Modified |
---|---|---|---|
edit | Launches an editor and opens the document for editing. | 0.3.0.0 | - |
find | Initiates a search starting from the specified directory. | 0.3.0.0 | - |
open | Launches an application. If this file is not an executable file, its associated application is launched. | 0.3.0.0 | - |
Prints the document file. | 0.3.0.0 | - | |
properties | Displays the object's properties. | 0.3.0.0 | - |
runas | Launches an application as Administrator. User Account Control (UAC) will prompt the user for consent to run the application elevated or enter the credentials of an administrator account used to run the application. | 0.3.0.0 | - |
Data is the Data to be Typed or Executed depending on the Macro Type specified. Additional Data can be sent to the macro by defining it in PowerToys run.
By default, all Additional Data sent is set as {0}
. Additionally, Specific Data can be selected using {#}
in which #
specifies which space-separated Data to use. Multiple Parts of Data can be returned using {#...#}
. Data that does not exist returns an empty string.
In this Example: macro:g cute cat feet videos
has the following Data:
Value | Data |
---|---|
{0} |
cute cat feet videos |
{1} |
cute |
{2} |
cat |
{3} |
feet |
{4} |
videos |
{5} |
Nothing |
{1...2} |
cute cat |
{1...4} |
cute cat feet videos |
{1...999} |
cute cat feet videos |
{3...4} |
feet videos |
{1...16777216} |
This will crash |
RunAfter can be set to run multiple Macros in succession. The same parameters from PowerToys run will be sent to each Macro. In the Example below, macro:SA Cat Pics
will search Google, Bing, and Yahoo for Cat Pics.
[SA]
Alias=SearchAll-G
[SearchAll-B]
Type=Command
Data=https://www.bing.com/search?q={0}
RunAfter=SearchAll-Y
[SearchAll-G]
Type=Command
Data=https://www.google.com/search?q={0}
RunAfter=SearchAll-B
[SearchAll-Y]
Type=Command
Data=https://search.yahoo.com/search?p={0}