Post by xxgeek on Aug 24, 2022 13:22:54 GMT -5
Creates the tkn file in same folder as selected .bas file.
Minimal code in this version.
Fully automated no user intervention to close the save and saved as windows
Select a known working .bas file or the debugger crashes this program.
Easy to understand.
'Name - AutoTKN - 'Version 2.0 - 'Created - Aug 2022 - 'Author - xxgeek, a member of the justbasiccom.proboards.com/ forums
'Creates the TKN file in same folder as selected .bas file
'(select ONLY known working .bas file.) debugger crashes program if errors in .bas file
'Increasing or decreasing pauses may be needed depending on YOUR hardware capabilities
nomainwin : LBpath$ = "c:\Program Files (x86)\Liberty Basic v4.5.1" : LBexe$ = "liberty.exe" : q$ = chr$(34)
'Write script to a .vbs file (script will automate closing of "Save *.TKN File As" and "saved as" windows
open "autoSave.vbs" for output as #1
#1, "Set WshShell = WScript.CreateObject(";q$;"WScript.Shell";q$;")"
#1, "WshShell.AppActivate ";q$;"Save *.TKN File As...";q$
#1, "WshShell.SendKeys ";q$;"{ENTER}";q$ 'sends the "enter" command to "Save *.TKN File As..." window
#1, "Wscript.Sleep(300)" 'slight delay - increase if needed
#1, "WshShell.AppActivate ";q$;"saved as";q$
#1, "WshShell.SendKeys ";q$;"{ENTER}";q$ 'sends the "enter" command to "saved as" window
close #1
'open file dialog to choose a .bas file
filedialog "Open \ Select a Just Basic Source File (.bas) ", DefaultDir$; "\*.bas", fname$ : if fname$ = "" then end
'Create the TKN file (in same folder as selected .bas file) - run script - pause - delete script file - end program
run LBpath$;"\";LBexe$;" -T -A ";fname$ : run "wscript ";"autoSave.vbs" : call pause 1500 : kill "autoSave.vbs" : end
'sub to create pauses in program
sub pause mil 'by tsh73
t=time$("ms")+mil
while time$("ms")<t
scan
wend
end sub