- press ENTER to search or ESC to cancel
Table of content
Globals namespaces
Constants
- Align
- AniDir
- BlendMode
- BrushPattern
- BrushType
- ColorMode
- FilterChannels
- Ink
- MouseButton
- MouseCursor
- RangeType
- SelectionMode
- SpriteSheetDataFormat
- SpriteSheetType
- WebSocketMessageType
Classes/objects
- Brush
- Cel
- Color
- ColorSpace
- Dialog
- Editor
- Events
- Frame
- GraphicsContext
- Grid
- Image
- ImageSpec
- KeyEvent
- Layer
- MouseEvent
- Palette
- Plugin
- Point
- Properties
- Range
- Rectangle
- Selection
- Site
- Size
- Slice
- Sprite
- Tag
- Tile
- Tileset
- Timer
- Tool
- TouchEvent
- Version
- Uuid
- WebSocket
- Window
app.command
app.command.CommandName()
app.command.CommandName { param1=value1, param2=value2, ... }
Executes the given command named CommandName
with the specified parameters.
-
app.command.About [UI]
- Opens the About Aseprite window
- app.command.AddColor
-
app.command.AdvancedMode [UI]
- Toggles the application's "Advanced Mode"
- app.command.AutocropSprite
-
app.command.BackgroundFromLayer
- Equivalent to using Convert To -> Background in the Layer's context menu
- app.command.BrightnessContrast [*]
-
app.command.Cancel
- Equivalent to pressing the Esc key
- app.command.CanvasSize [*]
- app.command.CelOpacity
-
app.command.CelProperties [UI]
- Shows the Properties dialog for the active Cel
- app.command.ChangeBrush [UI]
- app.command.ChangeColor [UI]
- app.command.ChangePixelFormat [*]
-
app.command.Clear
- Clear the current active document
-
app.command.ClearCel
- Clear the active cel in unlocked layers
-
app.command.ClearRecentFiles
- Clear the recent files list
-
app.command.CloseAllFiles [UI]
- Close all open files
-
app.command.CloseFile [UI]
- Close the active file
- app.command.ColorCurve [*]
- app.command.ColorQuantization [*]
-
app.command.ContiguousFill
- Changes the current tool to Contiguous Fill
- app.command.ConvolutionMatrix [*]
- app.command.CopyColors
-
app.command.CopyMerged
- Copies the active sprite as a merged image to the clipboard
-
app.command.Copy
- Performs a copy command on the current selection
- app.command.CropSprite
-
app.command.Cut
- Performs a cut command on the current selection
-
app.command.DeselectMask
- Deselects the current mask
- app.command.Despeckle [*]
-
app.command.DeveloperConsole [UI]
- Opens the developer console (experimental)
-
app.command.DiscardBrush [UI]
- Discard the active brush
-
app.command.DuplicateLayer
- Duplicate the currently selected layer
- app.command.DuplicateSprite [*]
-
app.command.DuplicateView [UI]
- Duplicates the current workspace view
-
app.command.Exit [UI]
- Instructs Aseprite to exit, the user will be prompted to save if any files are modified and it can be canceled
- app.command.ExportSpriteSheet [*]
- app.command.ExportTileset [*]
-
app.command.Eyedropper
- Grabs the color under the current mouse position with the Eyedropper tool
-
app.command.Fill
- Performs a foreground color fill on the current selection mask
-
app.command.FitScreen [UI]
- Resets the zoom on the current view to fit the screen
- app.command.FlattenLayers
- app.command.Flip
- app.command.FrameProperties [*]
- app.command.FrameTagProperties [*]
-
app.command.FullscreenPreview [UI]
- Opens the full screen preview
- app.command.GotoFirstFrameInTag [UI]
- app.command.GotoFirstFrame [UI]
- app.command.GotoFrame [UI]
- app.command.GotoLastFrameInTag [UI]
- app.command.GotoLastFrame [UI]
- app.command.GotoNextFrameWithSameTag [UI]
- app.command.GotoNextFrame [UI]
- app.command.GotoNextLayer [UI]
- app.command.GotoNextTab [UI]
- app.command.GotoPreviousFrameWithSameTag [UI]
- app.command.GotoPreviousFrame [UI]
- app.command.GotoPreviousLayer [UI]
- app.command.GotoPreviousTab [UI]
-
app.command.GridSettings [UI]
- Opens the grid settings window
-
app.command.Home [UI]
- Opens the Home tab
- app.command.HueSaturation [*]
- app.command.ImportSpriteSheet [*]
- app.command.InvertColor [*]
-
app.command.InvertMask
- Inverts the current selection mask, or if there is none, selects all
-
app.command.KeyboardShortcuts [UI]
- Opens the keyboard shortcut menu, use the
search
parameter to pre-fill the searchbar
- Opens the keyboard shortcut menu, use the
-
app.command.Launch
- Opens the given
path
in the desktop web browser as relative path to aseprite.org or a full URL
- Opens the given
-
app.command.LayerFromBackground
- Converts the active background layer to a regular layer
-
app.command.LayerLock
- Toggles the lock of active layers
- app.command.LayerOpacity
-
app.command.LayerProperties [UI]
- Opens the Layer property window for the active layer
-
app.command.LayerVisibility
- Toggles the visibility of the active layer
-
app.command.LinkCels
- Links the selected cels together
- app.command.LoadMask [*]
- app.command.LoadPalette [*]
-
app.command.MaskAll
- Selects all
- app.command.MaskByColor [*]
-
app.command.MaskContent
- Selects the content from the active sprite (like autocrop)
-
app.command.MergeDownLayer
- Merges the active layer down
- app.command.ModifySelection [*]
-
app.command.MoveCel [UI]
- Finishes the move operation of a cel in the timeline
- app.command.MoveColors
- app.command.MoveMask
-
app.command.NewBrush [UI]
- Create a new brush from the current selection/editor
- app.command.NewFile
-
app.command.NewFrameTag [UI]
- Shows the New Tag dialog for the selected frame range
- app.command.NewFrame
- app.command.NewLayer [*]
-
app.command.NewSpriteFromSelection
- Creates a new sprite from the current selection mask
-
app.command.OpenBrowser [UI]
- Open the given
filename
in the internal text browser
- Open the given
- app.command.OpenFile
-
app.command.OpenGroup
- Opens the active layer group
-
app.command.OpenInFolder
- Opens the folder of the active sprite in the file explorer
-
app.command.OpenScriptFolder
- Opens the Aseprite script folder in the file explorer
-
app.command.OpenWithApp
- Opens the active sprite with the native app assigned to the format
- app.command.Options [UI]
- app.command.Outline [*]
-
app.command.PaletteEditor [UI]
- Show the palette editor popup
- app.command.PaletteSize [*]
-
app.command.PasteText [UI]
- Opens the Insert Text dialog
-
app.command.Paste
- Pastes the clipboard into the current active sprite/selection, at coordinates
x
andy
(if given)
- Pastes the clipboard into the current active sprite/selection, at coordinates
-
app.command.PixelPerfectMode
- Toggles the "pixel perfect" freehand algorithm
-
app.command.PlayAnimation [UI]
- Plays the sprite's animation, if any
-
app.command.PlayPreviewAnimation [UI]
- Plays the animation in the preview window (enables it if it's not visible)
-
app.command.Redo
- Equivalent to
app.redo()
- Equivalent to
-
app.command.Refresh [UI]
- Refreshes the user interface
-
app.command.RemoveFrameTag
- Remove a tag by the given
name
or objectid
- Remove a tag by the given
-
app.command.RemoveFrame
- Remove the selected or the current active frame(s) (only if there's more 1 frame total)
-
app.command.RemoveLayer
- Remove the selected or current active layer(s) (only if there's more than 1 layer total)
-
app.command.RemoveSlice
- Remove a slice by
name
or objectid
- Remove a slice by
-
app.command.RepeatLastExport [*]
- Redoes the last export command
- app.command.ReplaceColor [*]
-
app.command.ReselectMask
- Re-selects a hidden selection mask
-
app.command.ReverseFrames
- Reverses frames (only if there are 2 or more in the selected range)
- app.command.Rotate
-
app.command.RunScript
- Run a script given by the
filename
parameter - any other parameters are passed to the script.
- Run a script given by the
- app.command.SaveFile [*]
- app.command.SaveFileAs [*]
- app.command.SaveFileCopyAs [*]
- app.command.SaveMask [*]
- app.command.SavePalette [*]
-
app.command.ScrollCenter [*]
- Center the editor viewport
- app.command.Scroll [UI]
-
app.command.SelectTile [UI]
- Select the tile under the mouse, with a selection
mode
(SelectionMode)
- Select the tile under the mouse, with a selection
-
app.command.SelectionAsGrid
- Set the grid bounds to the current selection mask
-
app.command.SetColorSelector [UI]
- Changes the color selector to the
type
:"spectrum"
,"tint-shade-tone"
,"rgb-wheel"
,"ryb-wheel"
or"normal-map-wheel"
- Changes the color selector to the
- app.command.SetInkType [UI]
- app.command.SetLoopSection
-
app.command.SetPaletteEntrySize [UI]
- Set the palette entry size to the given
size
(defaults to7
)
- Set the palette entry size to the given
-
app.command.SetSameInk
- Set the same ink for all tools
-
app.command.ShowAutoGuides
- Toggles the "Show Auto Guides" preference
-
app.command.ShowBrushPreview
- Toggles the "Brush Preview" preference
-
app.command.ShowExtras
- Toggles the "Show Extras" preference
-
app.command.ShowGrid
- Toggles the "Show Grid" preference
-
app.command.ShowLayerEdges
- Toggles the "Show Layer Edges" preference
-
app.command.ShowOnionSkin
- Toggles the "Onion Skin" preference
-
app.command.ShowPixelGrid
- Toggles the "Show Pixel Grid" preference
-
app.command.ShowSelectionEdges
- Toggles the "Show Selection Edges" preference
-
app.command.ShowSlices
- Toggles the "Show Slices" preference
-
app.command.SliceProperties [UI]
- Shows the slice properties window by
name
orid
parameters, otherwise uses the selected slice(s)
- Shows the slice properties window by
-
app.command.SnapToGrid
- Toggles the snap to grid property
-
app.command.SpriteProperties
- Shows the sprite properties window
- app.command.SpriteSize
-
app.command.Stroke
- Performs a foreground color stroke fill on the current selection mask
-
app.command.SwitchColors [UI]
- Swaps the current foreground/background colors around
-
app.command.SymmetryMode
- Sets the symmetry mode
orientation
to one of"vertical"
,"horizontal"
,"right_diagonal"
or"left_diagonal"
. Defaults to none, which turns the mode off
- Sets the symmetry mode
-
app.command.TiledMode
- Sets the tiled to mode
axis
to one of"both"
,"x"
or"y"
. Defaults to none, which turns the mode off
- Sets the tiled to mode
-
app.command.Timeline [UI]
- Changes the timeline visibility with the parameters
open
,close
andswitch
- Changes the timeline visibility with the parameters
-
app.command.TogglePreview [UI]
- Toggles the visibility of the preview window
-
app.command.ToggleTimelineThumbnails
- Toggles the timeline thumbnails preference
-
app.command.UndoHistory
- Shows the undo history window
- app.command.Undo
-
app.command.UnlinkCel
- Equivalent to
app.undo()
- Equivalent to
- app.command.Zoom [UI]
Annotations
*[]** - Can have UI interactions, controlled by the
ui
parameter.
[UI] - Requires the UI to be present, cannot be used in --batch mode.
Error Handling
If the command fails to run or is disabled, it will return false
.
To check if a command is enabled and can be run, you can use app.command.[COMMAND NAME].enabled
before calling it.
Source
If you cannot find a specific command, you might like to take a look at the gui.xml file which contains the definitions of menus / commands + the parameters.
To figure out the parameters of an undocumented command, you can:
- Choose a command (the
CommandName
part ofapp.command.CommandName
) from gui.xml file (<key command="CommandName" ...>
or<item command="CommandName" ...>
) -
If those
<key>...</key>
or<item>...</item>
XML elements contain children elements like<param name="param-name1" value="param-value2" />
you can specify those parameters in Lua between{ ... }
, for example:app.command.CommandName { ["param-name1"]="param-value1", ["param-name2"]="param-value2" }
Another alternative is looking to the Aseprite source code:
- Choose the command you want to use and find its counterpart
.cpp
file in src/app/commands/ (e.g.app.command.CropSprite
has the filecmd_crop.cpp
) - Find all places in the file where
params.get
is used, the strings in that function are the parameter names you need to use. -
When setting the parameters, you'll want to write the parameters as
below because Lua does not accept hyphens in identifiers.
app.command.CommandName { ["parameter-name"]="value", ["other-parameter-name"]="otherValue" }