Home Download Buy Blog Forum Support

[SOLVED] I can't get my macro to work

[SOLVED] I can't get my macro to work

Postby Lemon on Wed Jul 11, 2012 3:28 pm

I have been trying to create a macro in which one of the commands is to move the current file to group 1.

I took out the rest of the macro and left only the move_to_group command in and it still doesn't seem to work, although if I use the same command in a key binding it works fine.

This is my macro file:

Code: Select all
[
    {
        "command": "move_to_group",
        "args": {
            "group": 1
        }
    }
]


Is this ok or does move_to_group just not work in macros?
Last edited by Lemon on Thu Jul 12, 2012 3:47 am, edited 1 time in total.
Lemon
 
Posts: 27
Joined: Wed Jul 11, 2012 12:49 pm

Re: I can't get my macro to work

Postby Lemon on Thu Jul 12, 2012 3:47 am

I've found a solution.

It seems that move_to_group isn't a valid command for a macro or something like that so I found out how to run commands via a plugin.

This is what I wanted to do:

Code: Select all
import sublime, sublime_plugin

class PyReplCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.run_command('run_existing_window_command', {
            'id': 'repl_python_run',
            'file': 'config/Python/Main.sublime-menu'
        })

        sublime.active_window().run_command('move_to_group', {
            'group': 1
        })
Lemon
 
Posts: 27
Joined: Wed Jul 11, 2012 12:49 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 23 guests