Aren't both just a set of instructions that get executed by some interpreter? (contrary to a full-fledged program, which runs (gets executed) at some computer system?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.
Basically the difference is just one of degree. A script tends to be a lot more formally defined, with a well-defined scripting language behind it, while a macro is usually something more simple and ad-hoc. Macros are frequently "recorded" by telling a program "watch everything that I do" and then performing the action, whereas scripts are generally entered as text in the scripting language.
Macros come in different flavors.
The original kind was macros in assembly language, where a group of instructions could be named and each time the name was used the instructions were substituted for the name.
C and C++ also have macros that work this way.
But as with most things in IT, why have one term or one meaning when we can make things more confusing? So some environments (starting with MS Word, I believe) introduced "macros" that were a recorded set of actions.
So there are two kinds of macro. The first gets substituted for the name and then compiled. The second is usually interpreted at runtime by the environment.
The common usage of macros is in software applications, and they originated as a tool to map user input to a different set of user output. The key aspect here is the changing of user input/output at the application level. Since user input tends to be related to keyboards, mouse and other devices. The output changed by the macro was often previously recorded by one of those devices. There are also macros that can be written by the user but the goal is often to yield a desired output.
If macros are to application output, then scripts are to application automation. Scripts are often an application specific programming language that automate tasks for the user. The key here is the role of the user as a programmer, and the fact that users are not programmers. If you categorize scripting languages as those that don't compile, are parsed and easy to use then there are many languages that fit those requirements. I argue that scripting languages are the ones easiest for application users to automate the software with the least amount of programming knowledge. That is how they should be categorized as scripts. Anything that requires specialized knowledge outside the domain of the application is just programming tool.