Last active
January 7, 2019 23:32
-
-
Save igrep/843098ca14cf6fb918a7c9d4ce95a594 to your computer and use it in GitHub Desktop.
Export notes in evernote by date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-PSDebug -trace 2 | |
$FORMAT = "yyyy-MM-dd" | |
$QUERY_FORMAT = "yyyyMMdd" | |
$since = [DateTime]::ParseExact($args[0], $FORMAT, $null) | |
$until = if ($args[1]) { | |
[DateTime]::ParseExact($args[1], $FORMAT, $null) | |
} else { | |
Get-Date | |
} | |
$diff = $until - $since | |
0..($diff.Days - 1) | ForEach-Object { | |
$day1 = $since.AddDays($_) | |
$day2 = $day1.AddDays(1) | |
$outDayStr = $day1.toString("$FORMAT") | |
$outName = "enexs/$outDayStr.enex" | |
$enscript = "C:\Program Files (x86)\Evernote\Evernote\ENScript.exe" | |
$day1Str = $day1.toString($QUERY_FORMAT) | |
$day2Str = $day2.toString($QUERY_FORMAT) | |
Start-Process -FilePath $enscript -ArgumentList "exportNotes", "/f", "$outName", "/q", "`"created:$day1Str -created:$day2Str`"" -Wait -NoNewWindow | |
} | |
Set-PSDebug -trace 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment