fix as_script definition
fix as_script use; replace deprecated beginSheetModalForWindow:... call