vs code macro for wrapping code in if statement

i want to create a macro for wrapping a selected line of code in if statement in vs code. i stumbled upon this youtube video about macros in vs code so i tried imitating the ‘ifWrap’ in the video but for some reason it just doesn’t seem to work. first download the macro-commander extension. then paste the this code in settings.json file and create the snippet need for it. and that’s it, everything should have worked but it didn’t so here is the code,

"editor.action.clipboardCutAction",
      {
        "command": "editor.action.insertSnippet",
        "args": {
          "name": "iff"
        }
      },
      {
        "command": "type",
        "args": {
          "text": "true"
        }
      },
      "cursorLineEnd",
      "cursorDown",
      "editor.action.clipboardPasteAction"

this is the snippet that it uses(it doesn’t have scope i don’t know why but it is not allowed for some reason),

"iff":{
    "prefix": "iff",
    "body": [
        "if ($1) {",
        "t$0",
        "}"
    ],
    "description": "iff",
}

please help me and thank you.

i tried finding article related to it, tried asking questions to chatgpt, notebooklm, gemini but it didn’t worked.