writing scripts (not movie scripts)

235 views

I see people saying “I wrote a script to automate my job” or “I wrote a script to search for xxxx” and I have no idea what that means besides “computer stuff.”

In: 10

12 Answers

Anonymous 0 Comments

Scripting languages are those understood by the user shells of operating systems, as opposed to being compiled into binary code that the computer hardware understands natively. Let me back up.

Usually when you write software you use a _compiler_ which takes human readable code and crunches it into the binary instructions that make sense to a computer chip. To grossly oversimplify things when you launch an application in any operating system, the operating system just tells the computer hardware “start executing this”, and the hardware starts at the program’s instruction 1.

An operating system’s shell is simply yet another program that is designed to allow the user to interact with operating system components and the computer. In Windows, the Windows Explorer program is that shell – it provides a desktop like environment, the start menu, task bar, handles running multiple programs at the same time and allows you to switch between. It also lets you open the file system in folders.

What a scripting language does is allows you to automate interactions with the operating system or various programs, so you the user don’t have to do it. And instead of compiling a program to do it (since compiled programs can interact with the operating system and other programs too) the instructions of the script are simply executed each time you “run” the script.

For example, lets say part of my job is to copy some files from one folder to another and print them to PDF, then email the PDFs to an email address. I could do each one at a time manually. Or I could write a script to do this, one file (but only 1 step instead of several), or I could write a script that just does it for however many files are in that folder. Heck, I could write a script that just sits there forever and as soon as a file shows up in that folder it PDFs it and emails it automatically.

In a similar way, lots of applications and games have their own scripting languages. Video games for example might let you script weapon auto-switches or quick hit weapon combos. Macros in Microsoft Office programs are just scripts in this context. They’re not compiled, but they are interpreted by the program or the operating system on demand.

You are viewing 1 out of 12 answers, click here to view all answers.