How to allow users to input the path to the scene in standalone Maya?

Hi everybody! I have a script that makes some modifications for each scene from the list and then saves objects in .fbx files by the existing directory. It runs in standalone Maya. Does anybody know how to allow users to input the path to the scene in standalone Maya?
Thank you!

if you’re running in a standalone, you can do two things:

  1. Pass in the arguments at the start. You can get them from sys.argv and pass them to your script from there.
  2. You can write a script which puts your maya standalone into a loop, where users input commands and the maya responds

The downside of #1 is that each invocation will create, run, and then destroy an instance of Maya. Slow and memory hungry if the tasks is simple>

The downside of #2 is that it requires human intervention, otherwise it’s jiust a command line program waiting for human input…

They are not mutually exclusive – you could create simple “program loop” that decided whether to run-and-quit or loop interactively based on the starting arguments