how would i go about opening the save as menu using python? I'm trying to create an add-on that executes a few steps before opening the save as menu.
I am the point where I can execute the options and save the file, but I would like to open the save as menu, instead of directly saving over an already existing file.

import bpy

bpy.ops.object.transform_apply(location=False, rotation=True, scale=False, 
properties=False)

bpy.ops.transform.rotate(value=1.5708, orient_axis='X', 
orient_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, 
use_proportional_edit=False, proportional_edit_falloff='SMOOTH', 
proportional_size=1, use_proportional_connected=False, 
use_proportional_projected=False)

bpy.ops.object.transform_apply(location=False, rotation=True, scale=False, 
properties=False)

bpy.ops.transform.rotate(value=-1.5708, orient_axis='X', 
orient_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, 
use_proportional_edit=False, proportional_edit_falloff='SMOOTH', 
proportional_size=1, use_proportional_connected=False, 
use_proportional_projected=False)

bpy.context.area.type = 'VIEW_3D'
bpy.ops.wm.save_as_mainfile()
bpy.context.area.type = 'TEXT_EDITOR'


This is what I currently have, is there any way to instead of saving directly to the save_as_mainfile() , open the save as menu?
In order to open the file browser you need the operator's invoke() function to be called. This can be accomplish by setting the execution context. Pass the argument 'INVOKE_DEFAULT' into the function call and the file browser will open.

bpy.ops.wm.save_as_mainfile('INVOKE_DEFAULT')


The manual explains the execution context in the following way:


  Execution Context
  
  When calling an operator you may want to pass the execution context.
  
  This determines the context that is given for the operator to run in, and whether invoke() is called or only execute().
  
  ‘EXEC_DEFAULT’ is used by default, running only the execute() method, but you may want the operator to take user interaction with ‘INVOKE_DEFAULT’ which will also call invoke() if existing.
  
  [...]