Home

OFF-SOFT.net

OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

ssmacro.macro Command

ssmacro.macro Command

This can execute a macro file with JSON format. Also you can register keybinding by this command and macro file.

Parameter

You should set file or path prameter. - file string (This is Macro file name(ext. installed dir + /macros/ + "file"). not set is error) - path string (This is Macro file name(full path). not set is error)

Example

The macro file format fill plain text(UTF8) and JOSN format. 1st step, you should create a macro file. The filename is "/home/hoge/sample_tag.json".

[
    "ssmacro.clear",
    "ssmacro.copy",
    {
        "args":
        {
            "characters": "<tag>"
        },
        "command": "ssmacro.insert"
    },
    "ssmacro.paste",
    {
        "args":
        {
            "characters": "</tag>"
        },
        "command": "ssmacro.insert"
    },
    {
        "args":
        {
            "count": 6
        },
        "command": "ssmacro.left"
    }
]

This structure is quite similar to a key binding format("keybindings.json").

  • command : a command containing the identifier of the command to execute.
  • args : a arguments of command.

Note : Nothing "key" and "when" that exists with key binding format.

If you set only strings without structure, it mean a command without parameters.

{
    "key": "ctrl+9",
    "command": "ssmacro.macro", "args": {"path": "/home/hoge/sample_tag.json"}
}

2nd step, you will setup keybinding. The above editing code will type with "keybindings.json" file that wad opened by [ File ] - [ Settings ] - [ Keyboard Shortcuts. ], and will save it.

After will save it, you will see "<tag> ... </tag>" by operation of "Ctrl + 8".
executing image




  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ