Jump to content
  • 0

Prepend note title with date


why?

Idea

Does anyone know how to create a or have a script that will take the note creation date and prepend it to the note title in a YYYYMMDD format?

 

Why you may ask? I've found exporting notes doesn't necessarily retain the creation date. This is a problem. Having the creation date in the title means it's permanent.

 

many thanks

 

Simon

Link to comment

14 replies to this idea

Recommended Posts

Don't know about scripts,  but you could always use an auto-text app - most seem to be able to add date/ time if you type a short code.

 

Never thought about that, seems a good idea!.

 

Regards

 

Chris

Link to comment
  • Level 5*

Does anyone know how to create a or have a script that will take the note creation date and prepend it to the note title in a YYYYMMDD format?

 

Why you may ask? I've found exporting notes doesn't necessarily retain the creation date. This is a problem. Having the creation date in the title means it's permanent.

 

many thanks

 

Simon

I don't have an answer for you except to suggest you slowly add them to your notes over time (I also prepend the date, but just us yymmdd http://www.christopher-mayo.com/?p=367). Pick ten a day and you'll be done in no time! Specifically, if you put your view into list view and show just the creation date and title, this will go by very quickly (here are instructions for adjusting your list view.

http://www.christopher-mayo.com/?p=106

Link to comment
  • Level 5*

Many thanks

 

I was dreading this! Is it any easier on the windows version of evernote?

It's the same process there with the list view. After renaming about 10,000 notes earlier this year (in an unsuccessful attempt to try and solve a bug with the iOS app), I know the pain involved!

In my case, I had the years in the titles (this is something I have been doing for a while), but I had a mix of languages and character types in the titles as well, so I was replacing everything with straightforward english terms.

Link to comment

Does anyone know how to create a or have a script that will take the note creation date and prepend it to the note title in a YYYYMMDD format?

 

Why you may ask? I've found exporting notes doesn't necessarily retain the creation date. This is a problem. Having the creation date in the title means it's permanent.

 

many thanks

 

Simon

 

Sorry I'm late to the party, but something like the following should do what you want.  Just change the "notesToRename" variable to whatever notebook or search you want to use.  (See Evernote's AppleScript Examples for an example search.)

 

Also note that this code doesn't do any clever testing.  If you run it twice, it'll prepend the date to the title twice.

tell application "Evernote"	-- Set the notes you want to rename here.	-- Just getting every note in the "Inbox" notebook.	set notesToRename to (notes in notebook "Inbox")		-- Looping over evernote notes.  Calling the current note "n".	repeat with n in notesToRename		-- Get the creation date of this note		set creationDate to creation date of n				-- Format the creation date as YYYYMMDD		set yyyy to year of creationDate		set mm to (month of creationDate) as number		set mm to (items -1 thru -2 of ("0" & (mm as string))) as string		set dd to (day of creationDate)		set dd to (items -1 thru -2 of ("0" & (dd as string))) as string				-- Concatenate all the little date parts together		set yyyymmdd to (yyyy & mm & dd) as string				-- Change the title		set title of n to yyyymmdd & " " & (title of n)	end repeatend tell
Link to comment

Hi John,

 

Many thanks for your help.

 

Is there anyway to change the date string to yymmdd? I realised that the "20" in the year is now superfluos.

 

many thanks!

 

Yeah, here you go.  I will say that the "20" isn't superfluous for sort order if you backdate notes.  I do like Jamie Rubin describes and change the creation date of notes to reflect their subject's creation date.  My scan of my birth certificate is from the 1900s.

 

Anyway, you know your notes better than I do, so here's the code:

tell application "Evernote"	-- Set the notes you want to rename here.	-- Just getting every note in the "Inbox" notebook.	set notesToRename to (notes in notebook "Inbox")		-- Looping over evernote notes.  Calling the current note "n".	repeat with n in notesToRename		-- Get the creation date of this note		set creationDate to creation date of n				-- Format the creation date as YYYYMMDD		set yyyy to year of creationDate		set yy to (items -1 thru -2 of (yyyy as string)) as string		set mm to (month of creationDate) as number		set mm to (items -1 thru -2 of ("0" & (mm as string))) as string		set dd to (day of creationDate)		set dd to (items -1 thru -2 of ("0" & (dd as string))) as string				-- Concatenate all the little date parts together		set yyyymmdd to (yyyy & mm & dd) as string		set yymmdd to (yy & mm & dd) as string				-- Change the title		set title of n to yymmdd & " " & (title of n)	end repeatend tell
Link to comment

Having seen GrumpyMonkeys naming convention (which is very similar to the way in which I store photographs on disk) I decided that renaming my note in ever not to the creation date would be a good idea - so I created an applescript, based on another example of adding text in front of the note body from veritrope.com I didn't find this thread :-(

 

However, this script depends on the Mac short date in System Preferences - so it's easy to change the format if you want to. I use YYYY-MM-DD, and that's what I set my system short date to. If your re-naming everything anyway, you can set the short date back after executing the script. 

 

It also only renames selected notes, not a whole notebook.

(*Evernote -- Add creation date to start of subjectVersion 1.0Gareth JonesJanuary 29, 2014The date added depends on the system date set in Sytem preferencessee http://henrysmac.org/blog/2014/1/4/formatting-short-dates-in-applescript.htmlderived from http://veritrope.com/code/evernote-add-text-to-beginning-of-notes======================================// OTHER PROPERTIES (DO NOT CHANGE)======================================*)property noteTitle : ""(* ======================================// MAIN PROGRAM======================================*)tell application "Evernote"		try		-- get selected notes				set theNotes to selection		-- loop through notes		repeat with theNote in theNotes			-- get the title			set noteTitle to (title of item 1 of theNote)			-- get the creation date			set noteDate to (creation date of item 1 of theNote)			-- create new title by concatenation			set newTitle to short date string of (noteDate) & " " & noteTitle as string			-- assign new title to the note			set (title of item 1 of theNote) to newTitle					end repeat			end try	end tell
Link to comment

Hi John,

 

Many thanks for your help.

 

Is there anyway to change the date string to yymmdd? I realised that the "20" in the year is now superfluos.

 

many thanks!

IMO, a four digit year is not superfluous. I have many notes that pre-date 1/1/2000 that have been migrated from whatever apps/devices I was using at the time. And that includes handwritten notes/journal entries that were subsequently scanned & added to a digital organizer. To each his own & all that jazz. But IMO/IME, using a four digit year is not that much of a hardship & allows one to add information that may predate 1/1/2000. Maybe if I was 16 years old, I would view this differently. ;-)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...