What happens if the user presses ^O, expecting a file open dialog that could navigate to other directories? Would the dialog be somehow integrated to the OS and run with higher permissions, and then notepad is given permissions to the other directory that the user selects?
There’s also a similar photos picker (PHPicker) which is especially good from 2023 on. Signal uses this for instance.