Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert Relative link for file and path on disk. Feature request ^v^ #470

Closed
yyangdid opened this issue Mar 8, 2022 · 5 comments
Closed
Labels
feature-request New feature or request wontfix This will not be worked on

Comments

@yyangdid
Copy link

yyangdid commented Mar 8, 2022

Is your feature request related to a problem? Please describe.
Insert Relative link for file and path on disk.

Describe the solution you'd like
The default storage location of my notebook is set to D:\OneNote\Notes,
I have many large and small files stored in D:\OneNote\Videos\ or D:\OneNote\Music\ or D:\OneNote\Others\ and more.

Now, I just can insert link use Ctrl+k, it's absolute link.

When I move D:\OneNote to E:\OneNote or D:\Work\OneNote, all links fail.

So, if I can insert relative link, relative to notebook, then I can move my directory at will.

And thank you for this very nice software. 👍

@stevencohn
Copy link
Owner

OneNote does not allow relative file attachments like that because it actually manages a copy of all attachments in its own cache directory. When you open an attachment, it's actually opening that copy in the cache, not the original.

Here's an example of how an attachment is described on a page natively:

<one:InsertedFile
   pathCache="C:\Users\steve\AppData\Local\Microsoft\OneNote\16.0\cache\00000BAI.bin"
   pathSource="C:\Users\steve\Downloads\Proficiency Masterclass.docx"
   preferredName="Proficiency Masterclass.docx" />

An alternative might be to add a command that "re-roots" all attachments, replacing a given root path like "C:\OneNote\Notes" with "E:\OneNote\Notes"... or in this case just replacing "C:" with "E:" !!

@stevencohn stevencohn added the feature-request New feature or request label Mar 8, 2022
@yyangdid
Copy link
Author

yyangdid commented Mar 8, 2022

I mean, insert a file or path link, just like http link, not file attachments.

Ctrl-k:
1
2
3

When I click the link to open this file in OneNote, I can edit and save this file, just like open it from Explorer.

This method is more flexible than using attachments, I can management and edit my file in OneNote, I can see the change when I open this file from Explorer. And when I open and edit the file directly from Explorer, I can see the change when I click this file link in OneNote, In fact, the same file is opened from OneNote and explorer.

The file attachments do not achieve this effect.

My English is not very good. I wonder if I have made it clear?

@stevencohn
Copy link
Owner

Sorry I missed the Ctrl-K part!

Unfortunately, no. OneNote doesn't like relative paths here either. In fact, it requires an absolute URL. In this case, it would look similar to

<one:T selected="all">
  <![CDATA[<a href="file://C:/Users/steve/Downloads/Complex.docx">Complex</a>]]>
</one:T>

It may be possible to add a OneMore command that changes all absolute references on a page but let me think about it

@yyangdid
Copy link
Author

yyangdid commented Mar 8, 2022

Thank you.

@stevencohn
Copy link
Owner

I think this is the same as using the build-in command Open Original as shown here

image

@stevencohn stevencohn added the wontfix This will not be worked on label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants