ikas-mc / ContextMenuForWindows11

Add Custom Context Menu For Windows11
GNU Lesser General Public License v3.0
1.85k stars 90 forks source link

Allow for URI protocols, #131

Closed Immac closed 3 months ago

Immac commented 4 months ago

For example using URI protocols from Obsidian, or Steam https://help.obsidian.md/Extending+Obsidian/Obsidian+URI steam://launch/958400/dialog

ikas-mc commented 4 months ago
{
  "title": "Menu-1715519518033",
  "exe": "quick-look://",
  "param": "",
  "acceptDirectory": false,
  "acceptDirectoryFlag": 7,
  "acceptFile": false,
  "acceptFileFlag": 4,
  "acceptMultipleFilesFlag": 1,
  "index": 0
}
{
  "title": "Menu-1715519518033",
  "exe": "explorer",
  "param": "quick-look://\"{path}\"",
  "acceptDirectory": false,
  "acceptDirectoryFlag": 7,
  "acceptFile": false,
  "acceptFileFlag": 4,
  "acceptMultipleFilesFlag": 1,
  "index": 0
}
Immac commented 3 months ago
{
  "title": "Menu-1715519518033",
  "exe": "quick-look://",
  "param": "",
  "acceptDirectory": false,
  "acceptDirectoryFlag": 7,
  "acceptFile": false,
  "acceptFileFlag": 4,
  "acceptMultipleFilesFlag": 1,
  "index": 0
}
{
  "title": "Menu-1715519518033",
  "exe": "explorer",
  "param": "quick-look://\"{path}\"",
  "acceptDirectory": false,
  "acceptDirectoryFlag": 7,
  "acceptFile": false,
  "acceptFileFlag": 4,
  "acceptMultipleFilesFlag": 1,
  "index": 0
}

My mistake, the protocol I was trying to use, did not do what I thought it did, so It messed up, thank you!

Immac commented 3 months ago

To anyone wondering I was able to do what I wanted, sort of, I wanted to open an obsidian vault using the context menu, but it seems the protocol just takes paths to files not to vaults, in any case, just with the GUI it was a matter of using quotations around the parameter. Just as an extra, I was not able to use the vault parameter because I can't get just the parent folder's name, it uses the whole path, so I had to use the path directly. image

ikas-mc commented 3 months ago

currently a limited number of variables supported, and if it is a complex uri, it is recommended to open it through a script