Telnet Script Access

FTP, SFTP, FTPS, and SSH/telnet console issues

Telnet Script Access

Postby webbr23 » Wed Nov 17, 2010 3:21 pm

It would save me lots of time if you could access Telnet from scripts. Ideally I want to sign onto my Solaris server and change directory on opening a project.

Ron Webb
webbr23
Newbie
 
Posts: 5
Joined: Thu Mar 27, 2008 11:27 pm

Re: Telnet Script Access

Postby jorrasdk » Thu Nov 18, 2010 2:54 am

There are no interface between the scripting environment and SSH/Telnet consoles. But feel free to send IDM support an enhancement request. See e-mail address at the top of the page.

But imagine something like:

UltraEdit.showConsole(true/false); <- show/hide console window

- - - - Handle terminal windows - - - -

UltraEdit.terminal.length; <- number of opened terminals in console window - always at least 1

UltraEdit.terminal[0].connect("accountname"); <- Connects a disconnected terminal window
UltraEdit.addTerminal(); <- add new terminal window, then read new index (UltraEdit.terminal.length - 1) and connect to account

UltraEdit.terminal[0].name; <- account name of terminal window

UltraEdit.terminal[0].connected; <- returnes true/false - read connection status of terminal window

UltraEdit.terminal[0].disconnect(); <- disconnects but keeps terminal window open

UltraEdit.terminal[1].remove(); <-- removes terminal window. When only one terminal left UltraEdit.terminal.length=1, remove() has no effect

UltraEdit.activeTerminalIdx; <- Index of active/visible terminal (read only)

UltraEdit.terminal[0].setActive(); <- set this terminal active

- - - - Handle individual terminal - - - -
(Interface for terminal uses existing interface based on select/copy/paste)

UltraEdit.terminal[0].copyAll(); <- copy all content of terminal window buffer (as much as are available) to active clipboard
UltraEdit.terminal[0].copy(); <- copy only content on terminal window buffer (as much as are available) since last action (paste() or connect())

(You can then access the content on the clipboard in the script and evaluate/parse the
result of your last command or your login).

(You then place next full command and "LF" on the clipboard - like: UltraEdit.clipboardContent = "cd /tmp"+ "\n"; )

UltraEdit.terminal[0].paste(); <- Paste contents of active clipboard to terminal window

Example: Where have we landed after login ?

Code: Select all
UltraEdit.clipboardContent = "pwd"+ "\n"; /* construct command */
UltraEdit.terminal[0].paste(); /* send command */
UltraEdit.terminal[0].copy(); /* read screen since last action to this action */
var terminalOutputLines = UltraEdit.clipboardContent.split("\n");
if(terminalOutputLines.length>0) {
  if(terminalOutputLines[0]=="/home/myhome/") {
    ...in the right place...
  }
  else {
    ... then what ?...
  }
}
else { ... error handling ...}

I think I will send this suggestion to IDM. But everybody else who thinks it is a good idea should do the same since the more people who request a feature the more likely it is that the feature is implemented in future versions of UE.

Cheers!
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark


Return to FTP/SFTP / SSH/Telnet

cron