Jump to content

How do I import notes while preserving the creation date?


Recommended Posts

  • Level 5*
4 hours ago, nesdroc said:

How do I import notes while preserving the creation date?

Export/Import of a .enex file preserves creation date    
afaik   The only missing information is notebook and note-id

Link to post
12 hours ago, DTLow said:

Export/Import of a .enex file preserves creation date    
afaik   The only missing information is notebook and note-id

That's great to know. I'm looking to import from other note apps. So files would probably be markdown, txt, doc or pdf. Anyway to convert to the format you're talking about?

Link to post
  • Level 5

The file type is not relevant, when imported as an attachment.

EN itself uses a branch of HTML as native note format. Attachments will be embedded into the note, and needs the native (or another) app to be opened.

Link to post
  • Level 5*
3 hours ago, nesdroc said:

I'm looking to import from other note apps. So files would probably be markdown, txt, doc or pdf.

So, importing a file ("probably be markdown, txt, doc or pdf")

You didn't mention a device/platform
I use a Mac with an import folder.  Notes are created automatically via Applescript.
The file creation date can be accessed and preserved as note creation date

>>Anyway to convert to the format you're talking about?

A different question.  
By default, the file is stored as an attachment to the note; the file type is preserved in original format
The script can easily convert text to the note format

Link to post

Thanks for the input!

I'm not sure if I'm missing something or you're are thinking I want to import files as attachments. 

I'm looking to migrate notes into Evernote. I'm on a Mac. If I drag 'n drop the note-files into Evernote it will create a new note with the content of the note-file I dropped. Thus, giving the new note in Evernote the creation date of today. I want to have the note-file's creation date I drop/import into Evernote be preserved. Is this possible? Otherwise the scenario is that if I migrate my 2000 notes from e.g. Bear app into Evernote all of them will have the creation date of today even though my notes span several years.

Link to post
  • Level 5*
38 minutes ago, nesdroc said:

I'm on a Mac. If I drag 'n drop the note-files into Evernote it will create a new note with the content of the note-file I dropped. Thus, giving the new note in Evernote the creation date of today.

As I said, I use an import folder which creates a new note using Applescript   
The script can set the note's creation date to a specific value assuming it can be retrieved

>>you're are thinking I want to import files as attachments

As I said, the script can convert text to the note format     
Other file formats can only be stored as note attachments

Link to post
51 minutes ago, DTLow said:

As I said, I use an import folder which creates a new note using Applescript   
The script can set the note's creation date to a specific value assuming it can be retrieved

>>you're are thinking I want to import files as attachments

As I said, the script can convert text to the note format     
Other file formats can only be stored as note attachments

Okay, that sounds good. Where would I get that script?

Link to post
  • Level 5*
19 minutes ago, nesdroc said:

Okay, that sounds good. Where would I get that script?

See 

 

Link to post
2 hours ago, DTLow said:

See 

 

Hmm.. I got the script working at first, but saw I need to handle the created date of the file I'm trying to import. So I added the creation date, but now nothing happens. The script doesn't process the file anymore. Haven't done anything in Applescript, so not sure what could be wrong or how to properly debug such script.

on adding folder items to thisFolder after receiving newFiles
	delay 5
	
	repeat with newFile in newFiles
		set createDate to creation date of newFile
		tell application "Evernote" to create note from file newFile created createDate
		tell application "Finder" to delete (newFile)
	end repeat
	
end adding folder items to

 

Link to post
  • Level 5*
29 minutes ago, nesdroc said:

I got the script working at first, but saw I need to handle the created date of the file I'm trying to import. So I added the creation date, but now nothing happens.

A good first attempt    
Correction for set createDate to creation date of newFile   
change to         tell application "Finder" to set createDate to creation date of newFile

Link to post
35 minutes ago, DTLow said:

A good first attempt    
Correction for set createDate to creation date of newFile   
change to         tell application "Finder" to set createDate to creation date of newFile

Ah, I see. 

I tried making similar line for modification date, but that does not work. Do I need to handle this differently? Seems like it's not a parameter that can be passed when creating a note like,

tell application "Evernote" to create note from file newFile created createDate modification date modificationDate

 

Link to post
  • Level 5*
26 minutes ago, nesdroc said:

Seems like it's not a parameter that can be passed when creating a note like,

Correct, however modification is a property of the note object
Change tell application "Evernote" to create note from file newFile created createDate
to           tell application "Evernote" to set theNote to create note from file newFile created createDate
This gives a note object to work with

Use code     set modification date of theNote to modificationDate

(screenshot from the Evernote dictionary shows properties that can be set)1290317905_ScreenShot2020-09-06at11_12_17AM.png.8c8476e029d244652e468a6f71a6851b.png

Link to post
3 minutes ago, DTLow said:

Correct, however modification is a parameter of the note object
Change tell application "Evernote" to create note from file newFile created createDate
to           tell application "Evernote" to set theNote to create note from file newFile created createDate
This gives a note object to work with

Use code     set modification date of theNote to modificationDate

Ah, got it now. Thanks a lot! 👍 Nifty this AppleScript.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...