You may read screenwriting articles and advice about how to prepare and write your script. Research, notes, character biographies, exploring the setting, writing the outline/structure of the story. Outline, outline, outline, outline. Most advice gets hung up on this issue. They say that you must sit down and work out all the beats of your story in the outline so that you know what to write when you sit down at your computer (see previous post about 'professional documents' to check out what an outline actually is).
Now with all screenwriting mantras and rules, this is to be taken with a pinch of salt. If you don't outline, it doesn't mean that your script will be an aimless and structureless wreck. Your talents as a storyteller should ensure otherwise (you hope). There are obvious benefits to charting out your story in all the relevant detail beforehand as it makes writing the screenplay a less daunting and challenging task whenever you hit a spot going: "what am I doing? where am I at?".
I enjoy the two sides of the outline argument. Sometimes I outline, and enjoy it, and write an okay first draft, other times I just wing it, with equal success. It's interesting to note that in writing for television - you have to write an outline before you proceed to script stage. You have no choice. The script editor, producer and series producer want a good idea of what you're going to write before you actually write it (and pay you for the privilege). This outline is often referred to as a 'Step Outline' or a 'Scene by Scene breakdown' where you describe the key elements of each scene.
Most writers probably avoid this approach for their screenplays. Which is fair enough - as I say, I'm not saying one or the other. I think having a broad outline of the story is always a good idea, so you have some sense of the finishing line, and then let your creative impulses to surprise you along the way. But sometimes, the creative process doesn't work like that and there's nothing better than sitting down to the blinking cursor on a blank page and letting rip. In my scripts, half have been outlined and preppped, the others developed from a seed of an idea or character that I was interested in.
The script that won the BBC Tony Doyle Bursary last year was written on the hoof. I let the story and characters dictate where they wanted to go. The result was a well-written script that won the award but not entirely satisfactory as a dramatic experience (still, as a first draft, I was very pleased). The script was optioned by Irish actor Liam Cunningham and Parallel Films, and armed with their notes, I went back to the drawing board of 'scene by scene' so I could chart out the drama and structure to a more professional level.
The combination of the 'free story' approach and lateral preparation has been great, and it's increased my overall attachment and love of the project as a whole. Not all my projects have originated or developed in this way but I feel comfortable with the various processes available, so taking the right approach when you need it is the key. Don't be swayed by the gurus or any hard rule that they say must be obeyed. If you can write great stuff but without an outline or whatever, then keep spinning that magic baby.