# S.Pothier 5/28/83 (Old, but sill a useful basis for your own custom export routine /H) # Write all scripts in MetaCard stack to text file. on mouseUp ask file "Where do you want to put the scripts?" \ with "mc_scripts.txt" if it is empty then exit mouseUp end if put it into file_name put file_name open file file_name for write if the result is not empty then answer ("Couldn't open file. " && result() & " : " & (the sysError)) with "OK" exit mouseUp end if set the cursor to watch set the defaultStack to the topStack write ("SCRIPTDUMP_START: " & the long name of this stack&cr&the long date&&the time&cr&return) to file file_name write ("CONTROL_TYPE: MAINSTACK" & return) to file file_name write (the script of this stack) to file file_name write ("END_OBJECT" & return & return) to file file_name repeat with i = 1 to the number of cards write ("CONTROL_TYPE: BUTTONS" & return) to file file_name repeat with b = 1 to the number of buttons of card i put the long name of button b of cd i into o_name write ("OBJECT: " & o_name & return) to file file_name write (the script of button b of cd i) to file file_name write ("END_OBJECT" & return & return) to file file_name end repeat write ("CONTROL_TYPE: IMAGES" & return) to file file_name repeat with im = 1 to the number of images of card i put the long name of image im of cd i into o_name write ("OBJECT: " & o_name & return) to file file_name write (the script of image im of cd i) to file file_name write ("END_OBJECT" & return & return) to file file_name end repeat write ("CONTROL_TYPE: FIELDS" & return) to file file_name repeat with f = 1 to the number of fields of card i put the long name of field f of cd i into o_name write ("OBJECT: " & o_name & return) to file file_name write (the script of field f of cd i) to file file_name write ("END_OBJECT" & return & return) to file file_name end repeat write ("CONTROL_TYPE: SCROLLBARS" & return) to file file_name repeat with s = 1 to the number of scrollbars of card i put the long name of scrollbar s of cd i into o_name write ("OBJECT: " & o_name & return) to file file_name write (the script of scrollbar s of cd i) to file file_name write ("END_OBJECT" & return & return) to file file_name end repeat end repeat write "SCRIPTDUMP_END" to file file_name close file file_name end mouseUp