Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Hocking latenitefilms

View GitHub Profile
@latenitefilms
latenitefilms / mmh.lua
Created Sep 13, 2022
Middle Mouse Hold
View mmh.lua
local currentTool
middleMouseButtonTap = hs.eventtap.new({hs.eventtap.event.types.otherMouseDown, hs.eventtap.event.types.otherMouseUp}, function(ev)
if cp.apple.finalcutpro.isFrontmost() then
local buttonState = ev:getButtonState(2)
if buttonState then
--------------------------------------------------------------------------------
-- Middle Mouse Button Pressed:
--------------------------------------------------------------------------------
currentTool = cp.apple.finalcutpro.timeline.toolbar.tool()
hs.eventtap.event.newKeyEvent("h", true):post()
@latenitefilms
latenitefilms / loupedeck.lua
Created Aug 30, 2022
Restart Loupedeck Software on Wake from Sleep
View loupedeck.lua
local loupedeckServiceBundleID = "com.loupedeck.Loupedeck2"
local loupdeckConfigBundleID = "com.loupedeck.loupedeckconfig"
shouldRestart = false
local function sleepWatcherCallback(event)
if event == hs.caffeinate.watcher.systemWillSleep then
-- If going to sleep, lets kill the Loupedeck Service:
local app = hs.application.get(loupedeckServiceBundleID)
if app then
@latenitefilms
latenitefilms / automate.lua
Created May 1, 2019
A plugin that creates new FCPXML's based off JSON data
View automate.lua
--- === plugins.finalcutpro.automate ===
---
--- A plugin that creates new FCPXML's based off JSON data.
local log = require("hs.logger").new("automate")
local json = require("hs.json")
local tools = require("cp.tools")
local fcp = require("cp.apple.finalcutpro")
@latenitefilms
latenitefilms / FFAudioChannelLayouts.xml
Created Mar 19, 2018
Final Cut Pro 10.4 - Added "Stereo + 3 Mono" & "EBU R123:16c (5.1 with Music & Effect)" Audio Configuration
View FFAudioChannelLayouts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE AudioChannelLayouts
[
<!ELEMENT AudioChannelLayouts (LayoutCategory)*>
<!ELEMENT LayoutCategory (layout)*>
<!ATTLIST LayoutCategory ChannelValence CDATA #REQUIRED>
<!ELEMENT layout (name, channel_valence, item*)>
<!ELEMENT item (name, channel_map?, routing_map?)>
<!ELEMENT channel_map (channel)*>
<!ELEMENT routing_map (routing)*>
@latenitefilms
latenitefilms / FFAudioChannelLayouts.xml
Created Mar 15, 2018
Final Cut Pro 10.4 - Added "Stereo + 3 Mono" Audio Configuration
View FFAudioChannelLayouts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE AudioChannelLayouts
[
<!ELEMENT AudioChannelLayouts (LayoutCategory)*>
<!ELEMENT LayoutCategory (layout)*>
<!ATTLIST LayoutCategory ChannelValence CDATA #REQUIRED>
<!ELEMENT layout (name, channel_valence, item*)>
<!ELEMENT item (name, channel_map?, routing_map?)>
<!ELEMENT channel_map (channel)*>
<!ELEMENT routing_map (routing)*>
@latenitefilms
latenitefilms / KeywordEditor.lua
Created Jan 24, 2018
Revised Keyword Editor for Sarah
View KeywordEditor.lua
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- F I N A L C U T P R O A P I --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--- === cp.apple.finalcutpro.main.KeywordEditor ===
---
--- Keyword Editor Module.
View MenuBar.lua
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- F I N A L C U T P R O A P I --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--- === cp.apple.finalcutpro.MenuBar ===
---
--- Represents the Final Cut Pro menu bar, providing functions that allow different tasks to be accomplished.
@latenitefilms
latenitefilms / keywords.lua
Created Jan 23, 2018
Keywords Plugin Temp Fix
View keywords.lua
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- K E Y W O R D S P L U G I N --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--- === plugins.finalcutpro.browser.keywords ===
---
--- Browser Keywords
View notificationValidator.lua
ax = require("hs._asm.axuielement")
app = hs.application("Final Cut Pro")
ae = ax.applicationElement(app)
o = ax.observer.new(app:pid())
processChildren = function(child)
failureCount = 0
failures = ""
for i, notification in pairs(ax.observer.notifications) do
local status, err = pcall(function() o:addWatcher(child, notification) end)
View CommandPost Version 1.0
--------------------------------------------------------------------------------
--
-- FINAL CUT PRO ENHANCEMENTS v1.0
--
-- Thrown together by Chris Hocking @ LateNite Films
-- https://latenitefilms.com
--
-- You can download the latest version here:
-- https://latenitefilms.com/blog/final-cut-pro-enhanced-match-frame/
--