2008-11-06

WScript & external libraries

For those interested in trying some google code

1) go here: http://code.google.com/p/datejs/
    ...to download date.js

2) Save this snippet in same folder as #1 as date_sample.wsf:
      <job>
      <script src='date.js'></script>
      <script>
      var ws=5;var dt=4096+0+64;var sn=WScript.ScriptName;
      var oSh=WScript.CreateObject('WScript.Shell');
      var disp_var;
      sn='Return day start';disp_var=Date.today();
      oSh.Popup(disp_var,ws,sn,dt);
      sn='Return next Friday';disp_var=Date.today().next().friday();
      oSh.Popup(disp_var,ws,sn,dt);
      sn='Return previous Monday';disp_var=Date.today().last().monday();
      oSh.Popup(disp_var,ws,sn,dt);
      </script>
      </job>
3) Double-click date_sample.wsf

If you have trouble saving code snippits see notes here.

No comments:

LibriVox's New Releases

Blog Archive

Powered By Blogger