Sublime Forum

Open a Windows application from Sublime with a macro

#1

Hi,
How can I use a Build System file with a macro to open another Windows application while still in Sublime Text3 ? It works with a hotkey binding, but I need to use it in a macro file, and the same command is ignored in a macro file. Isn’t the command syntax for macros and bindings the same?

Here is a Build System file that opens another program:
{
“cmd”: “ColorPicker.exe”,
“path”: “/Program Files/Visual Color Picker 2/”,
“working_dir”: “C:/”,
}

Build System file saved as: Color-pick-cmd.sublime-build
Folder: Sublime Text\Data\Packages\User

Here is the line to set up the hotkey in Key Bindings - User:

{ “keys”: “f4”], “command”: “build”, “args”: {“variant”: “color-pick-cmd”} }
]

It is saved in file: Default (Windows).sublime-keymap
Folder: Sublime Text\Data\Packages\User

The hotkey works great - press F4 and it opens an alternate Color Picker dialog.

Now, here is the simple macro file:

{"command": "build", "args": {"variant": "color-pick-cmd"} },
{"command": "move", "args":{ "by": "lines", "forward": false} }

]

File saved as: Color-picker2.sublime-macro
Folder: Sublime Text\Data\Packages\User

The 2nd line is there just to confirm that the macro is working. When you run it, the cursor moves up one line, but the line that runs the Build System file is ignored.

Am I doing something wrong in the macro?

Thanks for looking into this.

0 Likes