PATCH_006.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. function PATCH_006_GET_PARTICIPANT_NAME() {
  2. let participant = Aliases.browser.page1011261948080.textnode.shadowroot.textnode.shadowroot.textnodeGeneralinformationcomp.shadowroot.textnodeTxtname.shadowroot.textbox.Text;
  3. let url = "C:\\Users\\vendor_qafusi4\\Documents\\S-INVEST GUI\\S-Invest GUI\\Data Source\\Data Input\\01. Participant Management\\Participant & Lifting of Suspension.txt";
  4. var today = new Date();
  5. var closing = new Date();
  6. var dd = String(today.getDate()).padStart(2, '0');//date today
  7. var dd2 = String(today.getDate() + 2).padStart(2, '0');// 2 Hari kemudian
  8. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  9. var yyyy = today.getFullYear();
  10. today = yyyy+'-'+mm+'-'+dd;
  11. closing = yyyy+'-'+mm+'-'+dd2;
  12. let template =
  13. 'participantName'+','+'effectiveDate'+','+'closingDate\n'+
  14. ''+participant+','+today+','+closing+''
  15. ;
  16. if (aqFile.Create(url) == 0)
  17. {
  18. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  19. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  20. }
  21. else
  22. {
  23. aqFile.Delete(url);
  24. if (aqFile.Create(url) == 0)
  25. {
  26. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  27. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  28. }
  29. }
  30. }