Hello!

MESS stands for Multifunctional Extendable Sequencing Solution, and is a Python program capable of making life easier. A healthy midpoint between RAM-hungry graphical user interface heavy overcomplicated automating solutions and, well, bare EMACS, MESS is a command-line interface (CLI) environment for quick and easy sketching of batch file manipulation scenarios, known as sequences.

Using just the built-in actions, it's possible in under a few minutes to create a sequence that, for example, extracts all .png files last modified later than 2014 from a folder (and all its subfolders recursively), copies them elsewhere, and then crops them all to the same size. Better yet, one can save and reuse this sequence as many times as they like to, on any directory.

MESS is easily extendable with custom actions: simply read the instructions, use the included action template, verify your action is working correctly, and you're good to go!

MESS is made for people who value the clarity of their visual space and the availability of their RAM and runs as a console application. The interface takes inspiration from early home computers, such as the Commodore 64 and the ZX Spectrum, remarkable for their instant result and hands-on appeal. It may be unusual for people used to graphical interfaces, however, a permanent resident of a terminal window will find themselves in their natural habitat. Whichever way you use it - run premade sequences, create your own ones, or even program your own actions - MESS is sure to deliver!~

Below you will find a list of available MESS downloads and an index of sections for further reading; be sure to RTFM before going crazy!

Downloads

Contents

Basics

When you first launch MESS, you will get the something like

enter action, dial in sequence number and action, or run a menu command. type 'help' to get help.

#:

Every time you see '#:' appear, the program waits for your input. In this case, you can already run your first command: 'help'. Type:

#: help

and press 'enter'. Two sections appear: 'Further help' and 'CLI commands'. 'Further help' contains commands that you can run to read help messages on the provided topics (also available on this page). 'CLI commands' are the commands available to you, the user, to run immediately inside MESS. Let's try running one of the available commands, 'actions', which shows you all the available actions. Type:

#: actions

and press 'enter'. A list of actions gets displayed: these are the core actions included with the basic MESS version. So far, the names most likely don't immediately connect to the meaning; after a bit of usage it's easy to remember what is what mnemonically.

NB! CLI commands are for checking the current status, saving, loading and so on. Actions are for manipulating files, making sequences out of, and doing the interesting stuff.

The 'actions' command does not tell anything about each action. However, you can learn about the action by typing its name and a question mark. Let's try learning about the mysterious 'sel' command:

#: sel?

Run the command, and 'sel' is immediately demystified as a select action!

selects the file in current path by a certain condition.

Get comfortable by checking some other CLI commands and reading about a few actions, until you are comfortable with the command line interface.

Status

MESS operates with the two main variables: path and selection. Path is the current working path: most actions will be executed inside it, or relatively to it. For example, the 'sel' command you learned about earlier selects files inside the working path based on a specified condition. Selection is a list of absolute paths to files currently targeted by MESS. Depending on the executed action, these files can be copied, altered, moved, deleted, and so on. Running 'sel' assigns the selected files' absolute paths to the selection as a list. Both path and selection are attributes of the status object. You could treat status as the 'memory' of the MESS environment. Most actions will read and/or manipulate attributes of the status.

You can check the main info about the current status by running the associated CLI command:

#: status

if you didn't run anything not mentioned in this manual, you should get something like

system status:
working path: unset
files selected: 0 (run 's' to see the list)

as you can see, currently, the status is not really telling anything. The working path is unset, and no files are selected. To change this situation, we would have to run some actions, which brings us to the next section.

Actions

Action is the basic useful command in MESS. While CLI commands provide you with information and allow certain save/load capabilities, actions may read and modify the status, perform operations inside the working path and on the file selection, and such. Each action is stored in its own .py file inside the 'actions' folder: right now, you have all the actions needed to complete this tutorial pre-packed. Let's run your first action now:

#: path

This is a basic action that sets the status working path to an absolute path provided by you, the user. It prompts you the path - give it something to work with (it better exist in your file system) - replace the path from my example with anything you'd like.

#-------------- preparing [path]
New path?
#: /Users/Astro/Desktop/test

After you have entered the new path, hit 'etner' - and you should get something along the lines of:

#-------------- running --- [path]
#--- SUCCESS: path, {'path': '/Users/Astro/Desktop/test'}

As you can see, the process consisted of two parts: preparation and runtime. When MESS is [preparing] the action, it asks you for the parameters you wish to run the action with. When [running] the action, MESS uses the prepared parameters you just entered. Every MESS action has these two obligatory parts. The 'path' action updates the current status working path, so now we can check it by running a corresponding CLI command.

#: p
/Users/Astro/Desktop/test

As you can see, the status path was updated with whatever directory you provided to the command (unless it didn't exist). You can also check it with a more familiar 'status' CLI command. Now, let's select some files. There is a number of variations of the 'sel' command. One of them is 'selall' - it selects all files in the working path, regardless of anything. Let's run it, and then check the new status selection with the 's' CLI command.

#: selall
#-------------- preparing [selall]
#-------------- running --- [selall]
#--- SUCCESS: selall, {}

#: s
/Users/Astro/Desktop/test/.DS_Store
/Users/Astro/Desktop/test/a.b.c.d.e.png
/Users/Astro/Desktop/test/binoculars
/* ... omitted just for the manual - too long ... */
/Users/Astro/Desktop/test/panini.txt
/Users/Astro/Desktop/test/pngrass.mp3
total files selected: 14

Congratulations, you just updated the status file selection! Now, you could run actions that move, copy, alter, rename these files, or anything else you come up with, but this does not make too much sense, as a lot of file managers can already do this sort of things. This is where the true power of MESS starts to shine - the...

Sequencer

Running actions one by one may work for some tasks, but the real aim of the MESS environment is to make life easier by creating ready-to-use sequences out of ready-made actions. The sequencer takes direct inspiration from ZX/C64 BASIC. It is very easy to start adding actions to the sequence: simply type an integer between 0 and 999, then the action name, and hit enter. For example, let's add a variation of the 'path' action, 'askpath'. The difference is, instead of preparing a hard-coded path and being unable to easily change it each time the sequence is ran, 'askpath' asks the user for a path each time it is executed. Set the message to whatever you'd like to show when the sequence reaches this action.

#: 10 askpath
#-------------- preparing [askpath]
message to user?
#: please, provide a path!
OK: 10 --> askpath (message:please, provide a path!)

As you can see, the prepare part of the action happened, but the run part didn't. That's because this 'askpath' is now stored in a sequence, ready to be ran. First, let's check the current sequence.

#: list
10 askpath (message:please, provide a path!)

As you can see, the sequence has 'askpath' with its parameters listed in the (braces) at the sequence number 10. Seems a bit empty at the moment, doesn't it? Let's add a couple more things.

#: 20 selall
#-------------- preparing [selall]
OK: 20 --> selall

#: 30 movesub
#-------------- preparing [movesub]
subfolder name? (letters and numbers only)
#: movedfile
OK: 30 --> movesub (subname:movedfiles)

#: list
10 askpath (message:please, provide a path!)
20 selall
30 movesub (subname:movedfiles)

We added a 'selall' command at number 20, and a 'movesub' (move to subdirectory, create if not existent) at number 30. The first sequence is done! So far it asks the user for a path, selects all the files in the said path, and moves them to a new subfolder inside that path. This could, however, be done with a GUI file manager, so let's spice things up a little bit by selecting files that only contain 'foo' in their name instead of all the files.

#: 25 sel
#-------------- preparing [sel]
Select the condition:
(N) fileName contians
(E) file Extension is
(M) filesize is More or equal then
(L) filesize is Less or equal then
(CE) creation date earlier than
(CL) creation date later than
(ME) modification date earlier than
(ML) modification date later than

#: N
Enter a string that will be looked for as part of the filename/the whole filename to select:
#: foo
OK: 25 --> sel (condition:name, value:foo)

Now we don't really need that 'selall' at 20, so we can remove it by using the 'no' CLI command. Setting up 'sel' on 20 would overwrite 'selall', too!

#: no 20
removed line 20

#: list
10 askpath (message:please, provide a path!)
25 sel (condition:name, value:foo)
30 movesub (subname:movedfiles)

Now, the sequence is actually useful. It selects all files with 'foo' in their names (but not extensions!) and moves them to a subfolder, which it also creates if it is not existing. This makes sense, so now you can run the sequence! Use your own path instead of the one i use for testing.

#: run
#-------------- running 10 [askpath]
please, provide a path!
input an absolute path
#: /Users/Astro/Desktop/test
#--- SUCCESS: askpath, {'message': 'please, provide a path!'}
#-------------- running 25 [sel]
#--- SUCCESS: sel, {'condition': 'name', 'value': 'foo'}
#-------------- running 30 [movesub]
#--- SUCCESS: movesub, {'subname': 'movedfiles'}

SUCCESS on all actions indicates that the sequence didn't fail. This does not necessarily mean it did precisely what you wanted it to do, however, in this case, it did. Note how the files with 'foo' in extension didn't get moved.

This sequence is very simple and short, yet, it already does something most GUI-based file explorers would be less efficient at. However, if you quit MESS just now, the sequence will be gone forever. To prevent this, MESS can...

Save/Load

The upside of MESS is that one can call the same sequence over and over at any time, against any directory. For this reason, a sequence save/load system exists. MESS saves sequences in JSON-formatted .seq files, located in the 'sequences' folder inside the MESS program folder. One can drag and drop sequences made by other users to this folder, and they will appear as a load option. But first, let's save the sequence you made so far.

#: save
input name to save this sequence under
#: movefoo
save OK!

All done! Now, quit MESS by running 'exit' or closing the terminal window. Launch it again, and 'list' the current sequence. You will get an empty line, as the current sequence indeed has nothing. However, you can now load the saved sequence like so:

#: load
available sequence files:

movefoo
pngdump
test

input one of the above file names to load it
#: movefoo
load OK!

#: list
10 askpath (message:please, provide a path!)
25 sel (condition:name, value:foo)
30 movesub (subname:movedfiles)

After loading 'movefoo', running 'list' shows exactly the sequence you've entered before, as simple as that! Now you can make and save sequences of all kinds to use them later on any destination. One can do a lot of things with built-in actions, however, a more tech-savvy user can write their own actions to extend MESS - and here's how.

Extensions

MESS is easily extendable. In the basic download there is the core set of actions, such as 'path', 'sel' and its many variants, 'move', and so on. More specific actions can be added to MESS very easily. Once you found an action file (has the .py extension) - simply put it to the 'actions' folder inside the MESS program folder. If you have MESS running already, execute a 'rescan' CLI command to have MESS check for additions to the actions folder. And you're done! Now you can use the freshly added action inside MESS for instant execution, or as part of a sequence.

If you're missing a specific action and know a way to realise it in Python, you can make your own action and add it to MESS. In the 'actions' folder, there is a file called 'template.py' - copy it, rename it to the name of the action you will be working on, and open it. To avoid collision between user-made actions, I suggest naming your custom actions as follows: [3-4 letters of your name/nickname/etc] + '_' + [actionname]. For instance, an extension made by me (Aubery 'Astro' Lis) that crops all photos from selection to a set size would be "ast_cropall".

Inside the template, you will find instructions on what an action has to have. As previously mentioned, an action consists of two phases: prepare and run. Likewise, the action .py file contains two main functions: prepare_params(status) and execute(params, status, verbose=False). Detailed description of the working mechanism is provided in the template, but long story short - 'prepare_params' returns a key-value dictionary of parameters for this action, and 'execute' uses the current status and the parameter dictionary to do useful stuff, and returns status (altered or unaltered). Names of parameters must be consistent between prepare and run functions!

You can also refer to core actions to see how the guts of an action are organised to better understand how to implement your idea. If you conjure something nice, feel free to hit me up through any of the contact methods and i may add your creation to one of the action packs!