-- $Id$ global configuration_delay property lf : ASCII character 10 on run argv set number_of_variations to item 1 of argv -- Base the delay for the configuration run on the processor speed. -- The multiplier was chosen based on observations of a 2.2-GHz -- MacBook Pro and a 466-MHz Power Mac G4. set cpu_mhz to (system attribute "pclk") / 1000000 set configuration_delay to 1400 * number_of_variations / cpu_mhz delay 3 -- wait 1 second for each disk image Mini vMac needs to mount my menu_edit_select_all() -- select the contents of the configure.args file which has been automatically opened my menu_edit_copy() -- copy it my menu_file_quit() -- quit my key_code(46) -- "M" -- select the MnvM_bld program my menu_file_open() -- open it my menu_edit_paste() -- paste the configure args into the window my menu_file_go() -- do the configuration return "Variations: " & number_of_variations & lf & "CPU speed: " & (round cpu_mhz rounding up) & " MHz" & lf & "Configuration delay: " & ((round configuration_delay * 100 rounding up) / 100) & " seconds" end run on key_code(key_code) my key_code_with_modifiers(key_code, {}) end key_code -- Key codes are used instead of keystrokes because keystrokes would be -- translated through the currently-selected Mac OS X keyboard layout -- but the system software being used on the emulated machine is using -- the US English keyboard layout. on key_code_with_modifiers(key_code, key_modifiers) activate application "@BOOTSTRAP_APP@" tell application "System Events" tell process "Mini vMac" delay 0.3 key code key_code using key_modifiers end tell end tell end key_code_with_modifiers on menu_file_open() my key_code_with_modifiers(31, {command down}) -- "Command-O" delay 0.5 -- wait for zoomrects to draw end menu_file_open on menu_file_go() my key_code_with_modifiers(5, {command down}) -- "Command-G" delay configuration_delay -- wait for configuration to run end menu_file_go on menu_file_quit() my key_code_with_modifiers(12, {command down}) -- "Command-Q" end menu_file_quit on menu_edit_copy() my key_code_with_modifiers(8, {command down}) -- "Command-C" end menu_edit_copy on menu_edit_paste() my key_code_with_modifiers(9, {command down}) -- "Command-V" end menu_edit_paste on menu_edit_select_all() my key_code_with_modifiers(0, {command down}) -- "Command-A" end menu_edit_select_all