Starting missions upon entering a system

Is there a way to do this? I mean without having a hidden mission beforehand that activates it?

As far as I'm aware, the only way to achieve this effect is to have a hidden mission that creates a ship in the system where you want the mission to kick off. Then, set the objective to "observe" and on ShipDone run the sXXX command. There are probably a few variations on this but I think that's the most straight-forward.

If you only want it to run the first time you enter the system you could try placing a nebula right where the system is and using its OnExplore field to start a mission.

Ah that just might work... hey the nebulae resource even has an activate on field. Should be just what I am looking for. Thanks!