In an electron app, I want to open a document from the user's computer, and place that file in a specific position on the user's screen. For example, open a locally saved txt file, and display it at the top right of the screen.
Hoping for a cross-platform solution, but I'd be ok starting with something for mac.
To open a file with electron, I can use the shell API, like this:
const { shell } = require('electron')
function openTheDoc(){
shell.openPath(documentPath)
}
Once it's opened, is there a way to place the doc in a specific location on the screen?
One potential solution would be to wrap the doc in an electron window (then I could control the placement of the electron window). Is it possible to wrap docs in electron windows? I see this question from a few years back saying no, but I'm wondering if things have changed.