Post by xxgeek on Aug 24, 2022 17:57:19 GMT
Automates the creation of the tkn file.
This version makes the tkn file in the same folder as the selected .bas file.
Minimal code for easy understanding.
This version makes the tkn file in the same folder as the selected .bas file.
Minimal code for easy understanding.
'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 : JBpath$ = "c:\Program Files (x86)\Just Basic v2.0" : JBexe$ = "jbasic.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 JBpath$;"\";JBexe$;" -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