When you are scripting in photoshop, you will notice not all operations you use in photoshop are found in the scripting reference. These operations can be used through the action manager (if the action is recordable).
Every action in these files are seperated by // ============. When you do a selection by color range for example, this action can be found in ScriptingListenerJS.log and looks like this:
You can then use this code directly in your other photoshop js scripts.