# Playlist

A Playlist is a list of macros and the number of times each of these macros should be played during the same browser session. This is mostly useful for automating iMacros from the command line. But you can also play a playlist directly from the UI.

## As a JSON file

Playlists are usually JSON files of the following format:

[
{
"macro": "Demo\\FillForm.iim",
"loop": 1
},
{
"macro": "Demo\\TagPosition.iim",
"loop": 3
}
]



The example above instructs iMacros to play Demo\FillForm.iim once and follow by playing Demo\TagPosition.iim 3 times in the same browser.

### Creating a playlist file

A playlist JSON file like the one above can be created using iMacros Editor.

To open the Playlist Generator dialog, click the Playlist button in the editor sidebar or from the File menu:

In the Playlist dialog you can add macros and change the number of times a macro should be repeated (loops number). You can also change the macro order by moving a macro up and down in the list, or remove it by clicking the trashcan icon. Finally, you can save the list to a .JSON file.

## Directly from the command line

You also can play a short playlist from the command line without creating an extra json file. Use the command line argument -playlist in the following format:

-playlist {"Demo\FillForm.iim":1,"Demo\TagPosition.iim":3}


Or, if you have saved your playlist as a JSON file called playlist.json in your macros folder, you can replay it from the command line with

-playlist "playlist.json"


If the playlist file is somewhere else, use its fill path instead.

-playlist "c:\full\path\to\playlist.json"


## Playing a playlist

A playlist can be played from:

• the command line as shown above
• a JSON file placed in the macros folder is shown on the macro tree view and can be played like a macro (play button, double click, context menu, etc)

## Remarks

• You cannot use iimPlay to play a playlist from the scripting interface
• If variables are passed on the command line with -variables, they will be set for each macro on the playlist.