Copy JSON Data from CueDB with Our Keyboard Maestro Starter Macro
Enjoy a 20% discount on Keyboard Maestro with the promo code CUEDB. We've teamed up with Keyboard Maestro, not for profit, but because we believe in the value it adds to your productivity.
Starter Macro
To jumpstart your automation projects, we've created a free-to-download Keyboard Maestro Starter Macro (Requires Keyboard Maestro v9.0+). Execute the macro from within any of your macros and you will get instant access to the cue data as variables.
Download the Starter Macro "JSON From CueDB v1.4"
Demos
Explore two distinct ways to leverage the macro based on your requirements below:
- Multi-Cue Loop Implementation: This method facilitates processing either multiple cues or a single cue. Despite its slightly more intricate setup, it is the recommended approach for most scenarios.
- Single Cue Execution: This approach is streamlined to handle only one cue. Choose this method if you're certain that the need to process multiple cues will never arise.
Multi-Cue Demo (loop)
Here's an example macro showing this in action and how to use it:
Download "Cue Data Popup (multi-cue)" (requires starter macro from above)
Cue Overview
- Click on any plain text cue cell in the Cue Overview (for example a Cue # cell) or select multiple cues by using the checkboxes.
- Press
Control + Option + Command + J
on your keyboard. This action will start the macro and copy the cue and current version data into your clipboard in JSON format.
Cue Details
- Open a cue version in the Cue Details view.
- Press
Control + Option + Command + J
on your keyboard. This action will start the macro and copy the cue and currently viewed version data into your clipboard in JSON format.
The result is a simple popup window displaying a variable from the retrieved data (or multiple popups if you checked multiple cues in the Cue Overview).
How to Use the Values
To retrieve Cue Number inside a loop, use the following syntax: %JSONValue%jsonData[index].cue_number%
Breakdown:
%JSONValue%
: Token for value retrieval from JSON.jsonData
: The variable containing the JSON data from CueDB.[index]
: Index indicating the current cue in the loop..cue_number%
: Path to retrieve the variable containing Cue Number from the specified cue.
Custom Fields
To retrieve the value of a custom field, prefix the field name with custom. and use the following syntax: %JSONValue%jsonData[index].custom.my_field%
Ensure the Include in JSON Data checkbox is checked within the custom field settings.
Single Cue Demo (without loop)
Here's an example macro showing this in action and how to use it:
Download "Cue Data Popup (single cue)" (requires starter macro from above)
Cue Overview
- Click on any plain text cue cell in the Cue Overview (for example a Cue # cell) or select a single cue by using the checkboxes.
- Press
Control + Option + Shift + Command + J
on your keyboard. This action will start the macro and copy the cue and current version data into your clipboard in JSON format.
Cue Details
- Open a cue version in the Cue Details view.
- Press
Control + Option + Shift + Command + J
on your keyboard. This action will start the macro and copy the cue and currently viewed version data into your clipboard in JSON format.
The result is a simple popup window displaying a variable from the retrieved data.
How to Use the Values
To retrieve Cue Number, use the following syntax: %JSONValue%jsonData[1].cue_number%
Breakdown:
%JSONValue%
: Token for value retrieval from JSON.jsonData
: The variable containing the JSON data from CueDB.[1]
: Index indicating the first cue from that dataset (only one cue in this example)..cue_number%
: Path to retrieve the combined details of Cue Number.
Custom Fields
To retrieve the value of a custom field, prefix the field name with custom. and use the following syntax: %JSONValue%jsonData[1].custom.my_field%
Ensure the Include in JSON Data checkbox is checked within the custom field settings.
Learn More
Read more about copying JSON Data from CueDB and the variables that are available to use ยป
When attempting to copy data to the clipboard through a key command, browser restrictions might block the automatic operation, especially if you leave the browser and return (Firefox) or attempt to copy multiple cues simultaneously (Safari), and the API request takes longer. These restrictions ensure that clipboard modifications are short running and directly initiated by user actions, enhancing security and user control.
If such a restriction prevents the automatic copy action, CueDB will display a popup window as a workaround. This window includes a Copy button. You can click this button or press Enter on your keyboard to manually perform the copy operation.
The macro begins monitoring the clipboard for data as soon as it is activated and continues to do so for 10 seconds before timing out. This period is deliberately set to not only accommodate the completion time of the database request but also to give you ample time to manually click the copy button if the browser prevents the automatic copy process. This ensures that even with browser restrictions, you have enough time to successfully copy the data manually.