Shortcut Labs

Stockholm, Sweden

Flic App for Mac - Plugins



What is a plugin?

In short, a plugin is an action that can be created by anyone and loaded by the Flic app at a later time in order to extend the functionality of the app. This allows you to add actions that are by default not included in the app.

How to create a plugin

Before you create a plugin you must first decide what you want it to do. All the plugin really does is to let the Flic app know how this action should be displayed and how it should execute the programs that you have created when the Flic button is pressed. Contained within the plugin could for example be a Bash script, Shell script, Python script, AppleScript, or any other executable file format. Once you are happy with your scripts you can turn them into a plugin simply by creating a containing folder for them and adding a JSON config file.

In this short example we will show you how to make a plugin that can be used to take screenshots. Once complete it will appear in the Flic app and be configurable like any other action:

The screenshot action contains two options, "Interactive" and "Whole desktop". Each of these options are represented by a stand-alone script file which looks like this:

Make sure that the script files you create have the correct "Execute" file permission. Once you have all the scripts that you want to be included in your plugin you can go ahead and create a JSON config file with all the required information. In this case it will look like this:

It should be quite self-explanatory how the config file works, but for a reference we have listed the information below.

Once complete the plugin folder should look something like this:

How to load a plugin

In macOS every sandboxed application has a particular folder where script execution is allowed. So, in order for the plugins to work they have to be placed in that particular folder. Every time the Flic app is launched the application will load each plugin that is placed in this folder. This can also be done manually from the menu bar by navigating to "Plugins -> Reload Plugins".

The correct folder to place the plugin in is:

Just navigate to this folder using Finder and place the plugins there. Pressing the "Plugins -> Show Folder..." option from the menu bar will open a finder window with the correct folder for you.

You can download the a zipped version of the screenshot plugin used in this tutorial here: screenshotPlugin.zip

Last updated: 2017-05-22