home *** CD-ROM | disk | FTP | other *** search
- ; This PTM will run a PTB file currently being edited.
- ; It may also run many Notepad PTM files
- ; Step 2, get notepad file name
- debug(@off)
- :top
- ;Get name of current window, notepad window in this case
- A7896=WinGetAct() ; Use real obscure variable name here...
- ;Parse it to extract file name
- ParseData(A7896)
- ; If it is currently untitled, get user to enter desired name
- If stricmp(param3,"(UNTITLED)")!=0 then goto FileIsNamed
- param3=askline("RUNBATCH","Please enter desired filename","*.PTB")
- ;Write entered name to clipboard for quicker response
- clipput(param3)
- ;Get Save dialog box and boop filename into it. Also hit enter
- sendkey("!FA+{INSERT}{ENTER}")
- A7896=WinGetAct()
- if stricmp(A7896,"NOTEPAD")!=0 then goto saved
- ;User is overwriting a file. Drop back into manual operation
- exit
-
- :FileIsNamed
- ;Save file
- SendKey("!FS")
- :saved
- ;Minimize Window
- SendKey("!{SP}N")
-
- ;Run a PubTech Batch session with the indicated file
- A7895=param3
- call(param3,"")
-
- ;Wait until session over, then restore edit window
- WinWaitCls("Batch - %A7895%")
- Winshow(A7896)
- exit
-