General scripting
"Hofmann, Stefan" <[email protected]> Tue, 7 Mar 2006 14:39:27 +0100
| Newsgroups | gmane.comp.java.tn5250j.scripting |
|---|---|
| Message-ID | <[email protected]> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 6.0.6487.1"> <TITLE>General scripting</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P><FONT SIZE=3D2 FACE=3D"Arial">Hi!</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">I wanted to write a python script for = the tn5250j emulator. I searched for a general documentation or tutorial = but i could'nt find it anywhere. I only found <A = HREF=3D"http://tn5250j.sourceforge.net/scripting.html">http://tn5250j.sou= rceforge.net/scripting.html</A> , this site isn't enough for me to = understand it :( ... i don't know how exactly to install it. Can i get = further information anywhere?</FONT></P> <P><FONT SIZE=3D2 FACE=3D"Arial">I installed tn5250j to = c:\programme\tn5250j\ directory, and i added an further directory: = C:\Programme\tn5250j\lib\scripts . When i put a script in this directory = then it works in general, for example:</FONT></P> <P><FONT SIZE=3D2 FACE=3D"Arial">---------</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">screen =3D _session.getScreen()</FONT> <BR><FONT SIZE=3D2 = FACE=3D"Arial">screen.sendKeys("[enter]")</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">---------</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">But i get errors in a bit larger = scripts, for example:</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">---------</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">screen =3D _session.getScreen()</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">screenfields =3D = screen.getScreenFields()</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">fields =3D = screenfields.getFields()</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">for x in fields:</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> print = x.toString()</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> print = x.getText()</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">print "number of fields %s " = % screenfields.getSize()</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">---------</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">The error is "AttributeError: = getText" in this script.</FONT> </P> <BR> <P><FONT SIZE=3D2 FACE=3D"Arial">Thank you in advance for putting me in = right direction.</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">Stefan Hofmann.</FONT> </P> <BR> <BR> <BR> <BR> </BODY> </HTML> ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642