MaSH is an acronym for “Making Stuff Happen”. It is a scripting language for automating modern business, user and file-based processes by exposing the power and feature-set of Foldr. It’s been designed to be both feature-rich and powerful yet simple and forgiving.
MaSH scripts (or “mashlets”) can be written in an easy-to-read and friendly way using natural language terms. You can also use more common programming conventions such as curly braces and parentheses. Furthermore you can mix and match both of these types of syntax within your scripts (although to make it easier for others to parse we would not recommend doing this). It is designed to be loose and to work around you, rather than demanding strict adherence to a particular way of doing things.
Below is an example of a simple mashlet:-
# This sets the variable "myMessage" to the string of text "It's the weekend!"
set myMessage to "It's the weekend!"
# This sets the variable "currentDate" to the... current date!
set currentDate to mash.date.now()
# Check whether it's the weekend and if so, print out our message
if currentDate.isWeekend()
printline myMessage
end
And here is the same mashlet in more standard programming syntax:-
# This sets the variable "myMessage" to the string of text "It's the weekend!"
myMessage = "It's the weekend!"
# This sets the variable "currentDate" to the... current date!
currentDate = mash.date.now()
# Check whether it's the weekend and if so, print out our message
if (currentDate.isWeekend()) {
printline(myMessage)
}
In MaSH both versions are totally valid and MaSH will happily parse and execute either variant.
Comments
Throughout this guide (and above) you will see example mashlets which will have lines that start with a # symbol. These lines are known as comments and they are ignored by MaSH when a script is executed. They are a way to add useful information, instructions and explanations to your code and can also be used during testing as a way to disable a portion of the script without actually deleting the code.
# These lines will not be executed by MaSH
# if (currentDate.isWeekend()) {
# printline(myMessage)
# }