17 lines
741 B
Plaintext
17 lines
741 B
Plaintext
// Echo Server
|
|
// https://rosettacode.org/wiki/Echo_server#
|
|
|
|
#plist NSAppleEventsUsageDescription @"Access to Apple Events is needed for this task."
|
|
|
|
str255 theMessage
|
|
theMessage = "tell application " + CHR$(34) + "Terminal" + CHR$(34) + CHR$(10) + "activate" + CHR$(10)¬
|
|
+ "do script " + CHR$(34) + "ssh ::1" + CHR$(34) + CHR$(10) + "end tell" + CHR$(10)
|
|
|
|
AppleScriptRef script
|
|
script = fn AppleScriptWithSource( fn stringwithpascalstring (theMessage) )
|
|
fn AppleScriptExecute( script, null )
|
|
|
|
// Sends ssh ::1 as a terminal command to open a connection to the local host
|
|
// You need to enable Sharing - Remote Login in System Settings for a succesful login.
|
|
// Otherwise you will get a Connection Refused message from the terminal.
|