APPENDIX B
A Globalink Example Translating the ZFPSGX
The "start" program runs continuously.
A sample of the "start" program appears as follows:
:start
if FileExist("c:\products\raw\swrca")
GoSub swrca
endif
if FileExist("c:\products\raw\cwfsgx")
GoSub cwf
endif
if FileExist("c:\products\raw\rtpsgx")
GoSub rtp
endif
if FileExist("c:\products\raw\zfpsgx")
GoSub zfp
endif
TimeDelay(10)
Goto start
:swrca
FileMove("c:\products\raw\laxswrca", "c:\download\laxswrca", @false)
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\convswr.wbt")
FileMove("c:\download\laxswrca.trs", "c:\products\laxswrca.trs", @FALSE)
FileMove("c:\products\laxswrca.trs", "c:\download\swrcasp.txt", @FALSE)
RunWait("c:\download\upswrca.bat","")
return
:cwf
FileMove("c:\products\raw\cwfsgx", "c:\download\cwfsgx", @FALSE)
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\cwf.wbt")
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\convcwf.wbt")
RunWait("c:\download\upcwf.bat","")
return
:rtp
FileMove("c:\products\raw\rtpsgx", "c:\download\rtpsgx", @FALSE)
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\convrtp.wbt")
FileMove("c:\download\laxrtp~1.trs", "c:\products\laxrtp~1.trs", @FALSE)
FileMove("c:\products\laxrtp~1.trs", "c:\download\rtpsgxsp.txt", @FALSE)
RunWait("c:\download\uprtp.bat","")
return
:zfp
FileMove("c:\products\raw\zfpsgx", "c:\download\zfpsgx", @FALSE)
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\zfp.wbt")
RunWait("c:\Program Files\WinBatch\System\WinBatch.exe","c:\download\convzfp.wbt")
RunWait("c:\download\upzfp.bat","")
return
GoTo start
The issued ZFPSGX product enters the "raw" subdirectory. The "start" program detects a new ZFPSGX product in the "raw" subdirectory and moves the product file into an operational directory. The zfp.wbt file is run. This file puts the product into a wordprocessor, then saves it as a Rich Text Format (RTF) file so Globalink will translate properly. The language is the WBT language which executes commands by using the keyboard instead of the mouse.
Run("c:\progra~1\accessories\wordpad.exe","c:\download\zfpsgx")
TimeDelay(5)
SendKeysTo("~WordPad","!f")
TimeDelay(2)
SendKeysTo("~WordPad","a")
TimeDelay(2)
SendKeysTo("Save As","zfpsgx.rtf")
SendKeysTo("Save As","{TAB}")
SendKeysTo("Save As","r")
SendKeysTo("Save As","!s")
SendKeysTo("Save As","y")
SendKeysTo("~WordPad","!f")
SendKeysTo("~WordPad","x")
Next, the convzfp.wbt file is run. This file (in WBT language) calls up Globalink, opens up the product to be translated, prepares it to be translated by "cleaning up" the formatting glitches, translates it, then saves it as zfpsgxsp.txt.
Run("C:\ptwin60\ptwin60.exe","C:\download\zfpsgx.rtf")
TimeDelay(6)
SendKeysTo("Open:","~")
TimeDelay(8)
SendKeysTo("Globalink","!e")
SendKeysTo("Globalink","r")
SendKeysTo("Replace","...")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace",", ")
SendKeysTo("Replace","!a")
SendKeysTo("Replace","~")
TimeDelay(4)
SendKey("y")
TimeDelay(1)
SendKeysTo("Globalink","~")
SendKeysTo("Replace",".T")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace"," T")
SendKeysTo("Replace","!a")
SendKeysTo("Replace","~")
TimeDelay(2)
SendKeysTo("Globalink","y")
TimeDelay(2)
SendKeysTo("Globalink","~")
SendKeysTo("Replace",".S")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace"," S")
SendKeysTo("Replace","!a")
SendKeysTo("Replace","~")
TimeDelay(2)
SendKeysTo("Globalink","y")
TimeDelay(2)
SendKeysTo("Globalink","~")
...similar commands to get rid of ".Monday..." problems.......
SendKeysTo("Replace","EXTRE")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace"," EXTRE")
SendKeysTo("Replace","!a")
SendKeysTo("Replace","~")
TimeDelay(1)
SendKeysTo("Globalink","y")
TimeDelay(2)
SendKeysTo("Globalink","~")
SendKeysTo("Replace","NATI")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace"," NATI")
SendKeysTo("Replace","!a")
SendKeysTo("Replace","~")
TimeDelay(1)
SendKeysTo("Globalink","y")
TimeDelay(2)
SendKeysTo("Globalink","~")
...similar commands to make sure new lines remain intact during translation...
SendKeysTo("Replace","!u")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace","{TAB}")
SendKeysTo("Replace","~")
TimeDelay(2)
...getting rid of unwanted line breaks...
SendKeysTo("Globalink","^a")
SendKeysTo("Globalink","!m")
SendKeysTo("Globalink", "p")
TimeDelay(1)
SendKeysTo("Paragraph","!e")
SendKeysTo("Paragraph","~")
SendKeysTo("Globalink","y")
TimeDelay(1)
SendKeysTo("Globalink","{DOWN}")
...and now, the translation.......
SendKeysTo("Globalink","^d")
TimeDelay(185)
SendKeysTo("Globalink","!f")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","{DOWN}")
SendKeysTo("Globalink","~")
TimeDelay(1)
...save the file and exit.....
SendKeysTo("Save Translation as","c:\download\zfpsgxsp.txt")
SendKeysTo("Save Translation as","{TAB}")
SendKeysTo("Save Translation as","{TAB}")
SendKeysTo("Save Translation as","{TAB}")
SendKeysTo("Save Translation as","{DOWN}")
SendKeysTo("Save Translation as","{TAB}")
SendKeysTo("Save Translation as","{TAB}")
SendKeysTo("Save Translation as","~")
SendKeysTo("Save Translation as","y")
TimeDelay(3)
SendKeysTo("Globalink","!f")
SendKeysTo("Globalink","x")
SendKeysTo("Globalink","n")
Finally, the upzfp.bat file is run which includes the embedded zfp.scr file. These files upload the translated product and insert it into the web page. The ftp address, the username, and the password are uniquely defined by each office.
the upzfp.bat file:
@echo off
ftp -n -s:c:\download\zfp.scr
the embedded zfp.scr file:
open (ftp address)
(username password)
ascii
lcd c:\download
put zfpsgxsp.txt
disconnect
bye