Custom actions
A custom action is a command you define once and run on the selected files whenever you need it: resize images, run a project's tests, open files in a particular editor, or chain several steps together.
You create and manage actions in Settings ▸ Actions. Actions on the APPLICATION page are available in every workspace. Actions on the WORKSPACE page belong to one workspace; see Workspace actions.

Create an action
- Choose Vektor ▸ Settings… (⌘,) and click Actions in the APPLICATION group.
- Click New Action.
- Fill in the four tabs: General, Action, Conditions and File Types. A tab with a problem shows a warning sign.
- Click Save Changes.
The page lists your actions grouped by category. Each row shows the action's icon, name, kind and description, a switch to turn it on or off, and an options button with Edit…, Duplicate, Export… and Delete…. Double-click a row to edit it.
General tab
- Name (required) and Description.
- Icon: click Change Icon to pick a symbol, or Reset to use the action kind's own icon.
- Category: Files, Images, Documents, Media, Development, Archives, Utilities or Custom. Used to group the action in menus and in the list.
- Visibility: where the action is offered.
- Show in files context menu (on for a new action)
- Show in directories context menu
- Show for multiple selection (on for a new action)
- Show in toolbar
- Show in command palette (on for a new action)
Visibility only decides where the action is offered. Its conditions and file types still apply.
Action tab
Under Action type, choose what the action does.
Shell script
Runs a script in a shell.
- Shell:
/bin/zsh,/bin/bash,/bin/sh, or Other… to type the path of another shell. - The script itself, in an editor with syntax coloring.
The selected items arrive as the script's arguments. Use "$@" to get all of them exactly, whatever their names
contain. The Insert Variable menu adds "$@" or one of the variables listed in Variables at the
cursor.
For example, to count the lines of the selected files:
wc -l "$@"
"$@" or the variables, in double quotes, so names with spaces
work.Application
Opens an app with the selected items.
- Application (required): click Choose Application….
- Arguments: one argument per line. A line that is only
$VKT_SELECTED_FILESbecomes one argument per selected item. - Working directory: Active Directory, Selected File Directory or Custom Directory (type a path or click Choose…).
- Options:
- Wait for application to finish: runs a separate copy of the app's program and reports its exit code.
- Open application in background.
Apps opened by macOS start in the root folder; the folder you chose is also passed to them as VKT_WORKING_DIRECTORY.
If the app is already running and needs arguments, a second copy is opened.
Built-in action
Runs one of Vektor Commander's own commands on the selection, exactly as the menus do. Only commands that need no further input are offered: Compress, Duplicate, Copy to Other Pane, Move to Other Pane, Move to Trash, Open in Terminal, Copy Path, Refresh and Multi Rename. For Multi Rename you set up the renaming rules in the action itself.
AppleScript
Runs an AppleScript. The selected paths arrive as the list argv of on run argv; the variables are read with
system attribute.
Action sequence
Runs several of your actions in order, each on the same selection. Click the add button to add a step, and use each step's menu to Move Up, Move Down, Duplicate or Remove it. If a step fails, the steps after it do not run.
Variables
Scripts and application arguments can use these values. In a shell script, write them as "$VKT_FILE_NAME".
| Variable | Value |
|---|---|
VKT_SELECTED_FILES | Paths of all selected items, one per line. For names that may contain line breaks, use "$@" or VKT_SELECTED_FILES_LIST. |
VKT_SELECTED_FILES_LIST | Path of a temporary file listing every selected path, each ending in a NUL byte. Removed after the run. |
VKT_SELECTED_FILE | Path of the first selected item. |
VKT_SELECTED_DIRECTORY | Path of the first selected folder, if any. |
VKT_ACTIVE_DIRECTORY | The folder the active pane shows. |
VKT_ACTIVE_PANE | Which pane is active: left or right. |
VKT_ACTIVE_PROVIDER | Where the items are: local or s3. |
VKT_WORKSPACE | Name of the active workspace. |
VKT_FILE_NAME | Name of the first selected item, with its extension. |
VKT_FILE_PATH | Path of the first selected item. |
VKT_FILE_EXTENSION | Extension of the first selected item, without the dot. |
VKT_FILE_DIRECTORY | Folder containing the first selected item. |
VKT_FILE_URI | Location of the first selected item as a URI (file:// or s3://). |
VKT_WORKING_DIRECTORY | For an application action: the working directory you chose. |
If an argument uses a $VKT_… name that is not in this list, the editor warns that it will be passed as written.
When nothing is selected, the action runs on the folder the active pane shows.
Conditions tab
Conditions decide when the action is offered. Switch on Enable conditions, choose Match All rules or Any rule, and add rules:
- File name: is, is not, contains, does not contain, starts with, ends with, matches pattern (comma-separated
wildcards such as
*.jpg, *.png), or matches regular expression. - File size: compared with a size in a unit you pick. 1 KB is 1,024 bytes.
- Location: the path is, is not, contains, does not contain, starts with or does not start with a value.
- Selection: number of items, contains files, contains folders, files only, folders only, or mixed selection.
- Provider: whether the items are Local or on S3.
If you switch conditions off, the rules are kept and apply again when you switch them back on.
File Types tab
Choose All files, or Specific file types to offer the action only for some files. Match by File extension, MIME type or Uniform Type Identifier, pick from common types grouped as Images, Documents, Audio, Video, Archives and Code, or add your own under Custom file types. Folders are never filtered by type.
Test an action
In the editor, click Test Action. A summary shows the action, what is selected in the active pane, where the items are and the action type. Click Run Test to run it, or Choose Files… to test with other files. The result shows whether it succeeded, failed or was cancelled, with the exit code, standard output and standard error.
Where actions appear
Once saved and switched on, an action appears where its Visibility settings say, but only when its conditions and file types match the selection:
- Context menus: right-click a file or a folder. Up to six actions are shown; if more apply, the last entry is More Actions…, which opens the command palette with all of them.
- Pane toolbar: when at least one action has Show in toolbar, each pane's toolbar has an actions button (a lightning bolt, "Run a custom action"). It lists those actions for that pane's selection.
- Command palette: View ▸ Command Palette… (⇧⌘P). Type to search actions by name, description or category, and press Return to run the highlighted one. Actions that do not apply to the selection are listed too, marked unavailable with the reason. The palette also offers a few built-in commands, such as Multi Rename…, Analyze Disk Space, Synchronize Paths and Synchronize Directories…, and file conversions that apply to the selection.

Clicking outside the palette closes it.
Running an action
While an action runs, a "Running “‹name›”…" message with a Cancel button appears. When it finishes, the panes refresh if files may have changed. A successful action stays quiet unless it printed something, in which case the first line of its output is shown briefly. If it fails, a dialog shows what went wrong, with its output.
Imported actions ask first
You can share actions as files:
- Export… at the top of the page saves all actions of that page to a file; Export… in a row's options saves one.
- Import… shows a preview first: which actions will be added, which cannot be imported and why, and which need a command this version does not have. Click Import (or Import Valid) to add them.
Exported actions contain scripts, settings and rules, never passwords or secret keys.
An imported action that runs a script or an app is marked Imported in the list. The first time you run it, Vektor Commander shows what it will execute and asks "Run “‹name›”?", explaining that it runs with your permissions and can change or delete files. Click Run only if you trust it.
Custom actions are also part of a configuration export from Settings ▸ Advanced.
Delete an action
Choose Delete… in the action's options menu and confirm. If a sequence uses the action as a step, the confirmation names it: that sequence will not run until you fix it.

