Internationalisation
Bundled Plugins API
Command Line Tool
CommandPost offers an optional Command Line Tool, that allows you to trigger any arbitrary Lua code via Apple's Terminal.
The Command Line Tool uses hs.ipc.
To install the Command Line Tool, click the CommandPost menubar icon, then Preferences..., click the Advanced tab then the Install button.
After installing the Command Line Tool you can also trigger Lua via code the command line. For example:
1
cmdpost -c 'require("cp.plugins")("finalcutpro.timeline.lanes").selectClipAtLane(1)'
Copied!
This allows you to have all the power of CommandPost & it's Lua Scripting Engine, directly from the command line.
The man page of the command line tool is provided here:
1
NAME
2
cmdpost -- Command line interface to CommandPost.app
3
4
SYNOPSIS
5
cmdpost [-i | -s | -c code] [-r] [-n]
6
7
DESCRIPTION
8
Runs code from within CommandPost, and prints the results. The given code is passed to "hs.ipc.
9
handler" which normally executes it as plain Lua code, but may be overridden to do some custom
10
evaluation.
11
12
When no args are given, -i is implied.
13
14
-i Runs in interactive-mode; uses each line as code . Prints in color unless otherwise speci-
15
fied.
16
-c Uses the given argument as code
17
-s Uses stdin as code
18
-r Forces CommandPost to interpret code as raw Lua code; the function "hs.ipc.handler" is not
19
called.
20
-n When specified, interactive-mode does not use colors.
21
22
EXIT STATUS
23
The cmdpost utility exits 0 on success, and >0 if an error occurs.
Copied!
Last modified 1mo ago
Export as PDF
Copy link