@@ -58,17 +58,23 @@ def main():
5858 if not ok :
5959 return
6060 filename = srcfss .as_pathname ()
61- if not sys .argv : sys .argv .append ('' )
62- sys .argv .append (filename )
63-
64- # Loop over all files to be processed
65-
66- for filename in sys .argv [1 :]:
67- process (template , filename )
61+ tp , tf = os .path .split (filename )
62+ if tf [- 3 :] == '.py' :
63+ tf = tf [:- 3 ]
64+ else :
65+ tf = tf + '.applet'
66+ dstfss , ok = macfs .StandardPutFile ('Save application as:' , tf )
67+ if not ok : return
68+ process (template , filename , dstfss .as_pathname ())
69+ else :
70+
71+ # Loop over all files to be processed
72+ for filename in sys .argv [1 :]:
73+ process (template , filename , '' )
6874
6975undefs = ('????' , ' ' , '\0 \0 \0 \0 ' , 'BINA' )
7076
71- def process (template , filename ):
77+ def process (template , filename , output ):
7278
7379 print "Processing" , `filename` , "..."
7480
@@ -93,6 +99,8 @@ def process(template, filename):
9399 destname = filename + ".applet"
94100 rsrcname = filename + '.rsrc'
95101
102+ if output :
103+ destname = output
96104 # Copy the data from the template (creating the file as well)
97105
98106 tmpl = open (template , "rb" )
0 commit comments