Good day... I am trying to open a new tab via Javascript for SFTP. I have used the vbscript guide example as a basis, but it is not working. It would be great if there were a version of that guide in JS to use!
In any case, here is what I have, any insights would be greatly appreciated!
Code:
// SFTP test
var objTab;
var objSFTPTab;
objTab = crt.Session.ConnectInTab("/S");
//objTab.Caption = "New SFTP Tab";
// Create an SFTP tab associated with the existing tab
objSFTPTab = objTab.ConnectSFTP();
// Wait for the SFTP tab to be ready for input.
objSFTPTab.Screen.Synchronous = true;
crt.Sleep(1000);
objSFTPTab.Screen.Send(String.fromCharCode(13));
objSFTPTab.Screen.WaitForString("sftp>");
// Upload all .txt files in the current local working directory to
// the current remote working directory.
objSFTPTab.Screen.Send("put *.txt" + String.fromCharCode(13) + String.fromCharCode(10));
objSFTPTab.Screen.WaitForString("sftp>");
// Close the SFTP tab
objSFTPTab.Close();
// Close the connection on the originating SSH2 connection's tab
objTab.Session.Disconnect();