Search code examples
sublimetext2sublimetextsublimetext3sublime-text-plugin

"unable to open" a sublime text macro file


When I run my macro in sublime text, I get "unable to open:'file path'". The sintax in keymap file is OK, I'm able to save it. This is the key map :

{ "keys": ["ctrl+="], "command": "run_macro_file", "args": {"file": "C:\\Users\\Bane\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\test.sublime-macro"} },

I'm using win7/64bit.


Solution

  • Your path to the macro file needs to start at the Packages directory, and use Unix-style path delimiters (/). So, your keymap should look like this:

    { "keys": ["ctrl+="], "command": "run_macro_file", "args": {"file": "Packages/User/test.sublime-macro"} },
    

    The paths are designed like this so the Packages directory can be portable, and the same command will work on all three supported operating systems.