Permalink
Browse files

New script for making pages in the format "Notes for Y-M-d"

  • Loading branch information...
1 parent 6fa4142 commit 94e0e8f13c4c9d5c690fafc0d94eb340f75014e6 @ccgus committed Nov 29, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 plugins-script/New Notes With Date Page.jstalk
@@ -0,0 +1,28 @@
+/*
+VPScriptMenuTitle = New Notes for Today Page
+VPShortcutMask = command control
+VPShortcutKey = 9
+*/
+
+
+function main(windowController, document) {
+
+ // set dateFormat to match your journal/log page names
+ var dateFormat = "Y-M-d";
+
+ var dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
+ [dateFormatter setDateFormat:dateFormat];
+
+ var pageName = "Notes for " + [dateFormatter stringFromDate:[NSDate date]];
+
+ [document openPageWithTitle:pageName];
+
+ var page = [windowController visibleItem];
+
+ [page setDataAsString:"<# #>"];
+
+ var textView = [windowController textView];
+
+ [textView selectNextTextPlaceholder:null];
+
+}

0 comments on commit 94e0e8f

Please sign in to comment.