Skip to content

Instantly share code, notes, and snippets.

@emisjerry
Created September 12, 2021 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emisjerry/7d4097da9cd20c73e953da1582ea1c53 to your computer and use it in GitHub Desktop.
Save emisjerry/7d4097da9cd20c73e953da1582ea1c53 to your computer and use it in GitHub Desktop.
Capture-format: test using QuickAdd inline javascript
```js quickadd
selection = window.getSelection();
selText = selection.toString()
console.log("selection", selText);
const activeFile = this.app.workspace.getActiveFile();
if (!activeFile) {
new Notice("No active file", 5000);
return;
}
console.log("active file=", activeFile);
new Notice("active file" + activeFile.name, 5000);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment