Skip to content
Discussion options

You must be logged in to vote

Hi,

thank you for your question. I took a look at the script you are trying to evaluate with Node.js.

// get all cm-lines in active tab
var lineText = document.querySelectorAll(".workspace-leaf.mod-active .cm-content .cm-line");

This code should be evaluated in Obsidian app, but your approach to launch a separate Node.js process would evaluate the JS code outside Obsidian. It seems that Node.js does not have a document object itself, which is why you are getting the error message Reference error: document is not defined.... But even if document would be present, the code would still not work outside Obsidian, because it would not have access to the content structure of Obsidian.

If you wa…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@ReaderGuy42
Comment options

Answer selected by ReaderGuy42
Comment options

You must be logged in to vote
4 replies
@ReaderGuy42
Comment options

@Taitava
Comment options

@ReaderGuy42
Comment options

@Taitava
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants