Editor script to make Play button always jump to a start scene

So you have say 10 scenes in a project. In any real project it "has to" begin on a particular scene, your scene 0, "GamePrep" which loads stuff to make the game work.

When you're working on the game in the editor. You might be working on some other scene, say scene 4.

Every single time you hit play in the editor, in reality you FIRST have to click to scene zero, and then hit play.

Would it be possible, using Editor Script magic, to fix this Common Problem ?

So, when you click or keystroke "Play", it changes you to scene 0, and only then "Play"s.

BTW Here's a full simple working solution based on everyone's amazing work below!

// IN YOUR EDITOR FOLDER, have SimpleEditorUtils.cs.
// paste in this text.
// to play, HIT COMMAND-ZERO rather than command-P
// (the zero key, is near the P key, so it's easy to remember)
// simply insert the actual name of your opening scene
// "__preEverythingScene" on the second last line of code below.
using UnityEditor;
using UnityEngine;
using System.Collections;
[InitializeOnLoad]
public static class SimpleEditorUtils
{
// click command-0 to go to the prelaunch scene and then play
[MenuItem("Edit/Play-Unplay, But From Prelaunch Scene %0")]
public static void PlayFromPrelaunchScene()
{
if ( EditorApplication.isPlaying == true )
{
EditorApplication.isPlaying = false;
return;
}
EditorApplication.SaveCurrentSceneIfUserWantsTo();
EditorApplication.OpenScene(
"Assets/stuff/Scenes/__preEverythingScene.unity");
EditorApplication.isPlaying = true;
}
}

Then there's this one I just put together because it works the way I WANT IT TO GAGAGAGAHAGHGH AND I AM ALWAYS RIGHT (it's slightly different and appeals to my usage needs, maybe it's good for learnin or whatever)

Mine will only play from scenes that are in the build settings, because I need control over some of my designers (e_e). Yoyo's uses a file dialog to pick a scene, could be worth combining them.

Please be aware that when building a game, the compiler has problems with inEditorCode when referencing the "using UnityEditor;"You can simply avoid this by just wraping the whole code in between of the folowing compile code:

#if UNITY_EDITOR
//Code
#EndIf

That should do the trick, the code won't be compiled when you build the game.

Enjoy!
Oh, also, there's some other useful tricks like how to make a checkable menu item correctly, or how to show a compile error like message in the scene view. Check them out in the code if you interested.