Jump to content

Macro/Automatic way to generate multiple notes each day?


Go to solution Solved by jefito,

Recommended Posts

Within the Windows desktop application, I'm looking for an easy way to hit a command/button to create multiple notes that then are inserted into multiple notebooks.  Does anyone have any suggestions on how this might be accomplished?

More specifically, I would like to create 4 notes at the beginning of each day so that it has the current date and that have a title formatted as listed below and placed each in their corresponding notebooks:

  1. Title = "YYYY-MM-DD - Work - Journal"   /  Notebook = "Work - Journal"
  2. Title = "YYYY-MM-DD - Work - To Do"   /  Notebook = "Work - TO DO"
  3. Title = "YYYY-MM-DD - Personal - Journal"   /  Notebook = "Personal - Journal"
  4. Title = "YYYY-MM-DD - Personal - To Do"   /  Notebook = "Personal - TO DO"

The body would initially be set to be blank.  Thanks

 

 

Link to comment
  • Level 5*
  • Solution

A simple PowerShell + ENScript solution:

# You may need to modify this according to the location of ENScript.exe
$ENscript = "C:\Program Files (x86)\Evernote\Evernote\ENScript.exe"

# Create an empty file for input into ENScript command
$out_file = "blank.txt"
$pre_file = ""
$pre_file | out-File $out_file -encoding ASCII

# Get the System date and format it to the Evernote expected format
$CurDate = Get-Date -Format "yyyy-MM-dd"

# Create notes...
$Notebook = "Work - Journal"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
# DEBUG: write notebook and title to console
#Write-Host "NoteTitle = " $NoteTitle " Notebook = " $Notebook
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Work - TO DO"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Personal - TO DO"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Personal - Notebook"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

#TODO: delete blank.txt if desired
#EXTRACREDIT: Make an array of notebook names so you can use a loop to create
#             each note title and the associated note

Not particularly elegant. I am not an expert PowerShell programmer.

  • Thanks 1
Link to comment
  • Level 5*
16 minutes ago, jefito said:

A simple PowerShell + ENScript solution:

Looks great, Jeff. I wish I still had a Windows machine to test it.

Any ideas on how to schedule execution of this script on a daily basis?

For those, like me, unfamiliar with PowerShell, this provides a good intro and summary:
PowerShell Commands Cheat Sheet 

  • Thanks 1
Link to comment
8 hours ago, jefito said:

A simple PowerShell + ENScript solution:


# You may need to modify this according to the location of ENScript.exe
$ENscript = "C:\Program Files (x86)\Evernote\Evernote\ENScript.exe"

# Create an empty file for input into ENScript command
$out_file = "blank.txt"
$pre_file = ""
$pre_file | out-File $out_file -encoding ASCII

# Get the System date and format it to the Evernote expected format
$CurDate = Get-Date -Format "yyyy-MM-dd"

# Create notes...
$Notebook = "Work - Journal"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
# DEBUG: write notebook and title to console
#Write-Host "NoteTitle = " $NoteTitle " Notebook = " $Notebook
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Work - TO DO"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Personal - TO DO"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

$Notebook = "Personal - Notebook"
$NoteTitle = '"' + $CurDate + " - " + $Notebook + '"'
& $ENscript createNote /i $NoteTitle /n $Notebook /s blank.txt

#TODO: delete blank.txt if desired
#EXTRACREDIT: Make an array of notebook names so you can use a loop to create
#             each note title and the associated note

Not particularly elegant. I am not an expert PowerShell programmer.

jefito,

Many thanks...this works perfectly and will speed up my morning routine tremendously. 

 

 

  • Like 1
Link to comment
  • Level 5*
5 hours ago, mismille said:

jefito,

Many thanks...this works perfectly and will speed up my morning routine tremendously. 

You're welcome. You could probably use Windows Task Scheduler to automate the whole thing.

  • Like 1
Link to comment

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...