Establishes a connection with a remote host. Corresponds to the Connect method.
Connect([Connection],AlreadyConnected)
Newlook Smartclient
Newlook Server
This macro action can be used in one of the following three ways:
Establishes a connection with a defined connection definition.
Connection - (String, Optional)
Specifies the predefined connection definition to use. Either type in a connection name or select one from the drop down list.
AlreadyConnected - (Integer, Optional)
Specifies what action to take if Newlook is already connected. Refer to AlreadyConnected constants for a list of pre-defined values that can be used with this parameter.
If AlreadyConnected is left blank, nlConnPrompt is used.
Leaving the Connection parameter blank forces the Connect Dialog to be displayed when the script runs. This option may be suitable if you wish to give users a choice of pre-defined connections.
Fig 1. Connect Dialog that displays if the Connection parameter is left blank.
Note: the option to generate the Connect dialog by leaving the Connection parameter blank is not supported in Newlook Server.
The following macro connects to the pre-defined connection "Test Connection".
Connect(Test Connection, ConnNewWindow)
Dynamically create or modify a connection definition at run-time, and connect to it.
Connection - (String, Optional)
Specifies a connection string. To dynamically modify or create a connection at run-time a valid connection string must be specified, with each connection property specified as an input=val pair, where 'input' is a string that is the name of the Connection property and 'val' is the value being supplied for that property.
AlreadyConnected - (Integer, Optional)
Specifies the action to take if Newlook is already connected. Refer to AlreadyConnected constants for a list of pre-defined values that can be used with this parameter. If AlreadyConnected is left blank, nlConnPrompt is used.
Properties that can be specified in a Connection string include:
To override an existing connection definition, you must specify the name of the connection you wish to override in the Connection property of the Connection string.
It is also possible to modify printer connections using this action. This is useful if you need to create a generic printer connection that can then be modified for different IP addresses and printer devices.
Note that it is not possible to override Advanced print settings or the HPT/SCS setting.
The following macro creates the connection "MyConnection", and then connects to it:
Connect(Connection=MyConnection;Network Address=192.168.1.1;Network Port=23;Display Device=JULIE1;Date Format=MM/dd/yyyy, nlConnTerminate)
The following macro connects to the existing "MyHost" connection definition, overwriting the Network Address, Display Device and Date Format properties in the connection definition with the values defined in the action's parameters. All other values in the existing connection definition will be unchanged:
Connect(Connection=MyHost;Network Address=acme.looksoftware.com;Display Device=JULIE1;Date Format=MM/dd/yyyy, nlConnTerminate)
The following macro connects to the existing "GenericPrinter" definition with custom Network Address and Printer Device properties:
Connect(Connection=GenericPrinter;Network Address=192.168.1.1; Printer Device=TESTPRT, nlConnTerminate)
Specifies the Telnet 5250 URL to connect to.
Connection - (String, Optional)
Specifies the telnet 5250 URL to connect to.
AlreadyConnected - (Integer, Optional)
Specifies the action to take if Newlook is already connected. Refer to AlreadyConnected constants for a list of pre-defined values that can be used with this parameter. If AlreadyConnected is left blank, nlConnPrompt is used.
To connect to a telnet 5250 session, use the following syntax:
tn5250://[username]:[password]@IP address:[port number]/[device name]:[case-sensitive]
nl5250://[username]:[password]@IP address:[port number]/[device name]:[case-sensitive]
To connect to a secure telnet 5250 session, use the following syntax:
tn5250s://[username]:[password]@IP address:[port number]/[device name]:[case-sensitive]
nl5250s://[username]:[password]@IP address:[port number]/[device name]:[case-sensitive]
The following script connects to the host via a tn5250 URL with the username JULIEM and password ab123AB with the case sensitive option turned on:
Connect(tn5250://JULIEM:[email protected]:23/:case-sensitive, nlConnTerminate)
Disconnect action | Connect method
© 2004-2021 looksoftware. All rights reserved.