title: VBScript in IBM Personal Communications, Register current date and time
body: <p>This is a bit complicated to explain but I sure will do my best!</p>
  
  <p>I want to register the current time and date "Year,Week,day + Time", in my program IBM Personal Communications (Session A). I have to use a .MAC extension for the final file in order for the program to read it.</p>
  
  <p>This is the code that I have at the moment:</p>
  
  <pre><code>[PCOMM SCRIPT HEADER]
  LANGUAGE=VBSCRIPT
   DESCRIPTION=
   [PCOMM SCRIPT SOURCE]
   OPTION EXPLICIT
   autECLSession.SetConnectionByName(ThisSessionName)
  
  REM This line calls the macro subroutine
  subSub1_
  
  sub subSub1_()
     autECLSession.autECLOIA.WaitForAppAvailable
     autECLSession.autECLOIA.WaitForInputReady
     autECLSession.autECLPS.SendKeys "151441652 " **&lt;--This is where the date has to appear**
  
     autECLSession.autECLOIA.WaitForInputReady
     autECLSession.autECLPS.SendKeys "[enter]"
  
     autECLSession.autECLPS.WaitForAttrib 12,1,"00","3c",3,10000
  
     autECLSession.autECLPS.Wait 3401 
  
     autECLSession.autECLOIA.WaitForAppAvailable
  
     autECLSession.autECLOIA.WaitForInputReady
     autECLSession.autECLPS.SendKeys "[pf12]"
  end sub
  </code></pre>
  
  <p>autECLSession.autECLPS.SendKeys "151441652 " &lt;--- The final values must appear here in the same order. The numbers have been entered manually by me. So what I essentially need the final program to do is to recognize the date and enter them manually.</p>
  
  <p>This is what the numbers stand for:</p>
  
  <p>15 = The year 2015</p>
  
  <p>14 = The current week, the date right now is 02-04-2015 which is Week 14</p>
  
  <p>4 = Day 4 of the week. thursday</p>
  
  <p>1652 = Current time, I need the time to be a 24hour clock.</p>