Tiled export before running command

How to make Tiled export a map before running a command?

You could do the export as part of the command (Tiled can perform exports via CLI), but you’ll need to make sure your map is saved first - the instance of Tiled doing the export in this case will be separate from your existing one, and will not know of any unsaved changes to your maps.

Another option is to make a Tiled script that both performs the export, and then runs the command. The scripting API is capable of both of these things. You can also make this run automatically triggered by certain actions, such as whenever you save the map, or make it an action that you can trigger with a hotkey.

Just note that when you enable the following two options:

  • Repeat last export on save (Preferences → General)
  • Save before executing (Edit Commands)

The result should be that executing the command will save and export before the command is executed.

1 Like