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

[OneNote] Fill File Properties during import #212

Closed
Korayem opened this issue Feb 13, 2024 · 5 comments
Closed

[OneNote] Fill File Properties during import #212

Korayem opened this issue Feb 13, 2024 · 5 comments
Labels
wontfix This will not be worked on

Comments

@Korayem
Copy link

Korayem commented Feb 13, 2024

I've been using OneNote since 2004, I want to migrate it into Obsidian but Created At and Last Updated At aren't imported though they're supported by Obsidian
image

@kepano
Copy link
Collaborator

kepano commented Feb 13, 2024

The creation date and modified date should be applied to the file itself at the file system level.

When you look at the file in File Explorer you should see those dates. Can you confirm?

Importing those dates as properties is not currently supported but you could populate those using a separate script or plugin.

@kepano kepano added the wontfix This will not be worked on label Feb 13, 2024
@Korayem
Copy link
Author

Korayem commented Feb 13, 2024

@kepano thanks for your answer. Indeed you're right.

I looked up how I can script this and this is my solution. However, when I do OneNote import, Templater doesn't trigger on created notes. Any ideas?

Here are the steps I took:

  1. Install Templater plugin
  2. Create the /templater/insert file property.md and add the following script
---
Created at: <% tp.file.creation_date() %> 
Last updated at: <% tp.file.last_modified_date() %>
---
  1. Go to Templater Settings and enable Folder Templates, which basically tells Templater to run a specific template whenever a new Note is created inside that folder. Mine is OneNote which I use to import notes into.
    image

@kepano
Copy link
Collaborator

kepano commented Feb 13, 2024

I would recommend asking on the forum or Discord as this out of the scope of Importer.

@kepano kepano closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2024
@Korayem
Copy link
Author

Korayem commented Feb 13, 2024

@kepano To debug the root cause, I created a new note manually inside OneNote and the above solution indeed worked. Templater inserted the File Property block.
image

The issue is with Obsidian Importer. For some reason, when it's importing files from OneNote and creating notes, it's not firing file created event hence Templater isn't detecting any new files.

So plz re-open this

@Korayem
Copy link
Author

Korayem commented Feb 13, 2024

Cross-linking a similar discussion on Obsidian forums for reference. I posted there also about this ticket to garner more people into the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants