Skip to content

Instantly share code, notes, and snippets.

View latenitefilms's full-sized avatar
🎛️
Working on Marker Toolbox

Chris Hocking latenitefilms

🎛️
Working on Marker Toolbox
View GitHub Profile
@latenitefilms
latenitefilms / mmh.lua
Created September 13, 2022 23:26
Middle Mouse Hold
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 August 30, 2022 02:03
Restart Loupedeck Software on Wake from Sleep
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 10:06
A plugin that creates new FCPXML's based off JSON data
--- === 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 March 19, 2018 21:58
Final Cut Pro 10.4 - Added "Stereo + 3 Mono" & "EBU R123:16c (5.1 with Music & Effect)" Audio Configuration
<?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 March 15, 2018 13:36
Final Cut Pro 10.4 - Added "Stereo + 3 Mono" Audio Configuration
<?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 January 24, 2018 12:55
Revised Keyword Editor for Sarah
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- F I N A L C U T P R O A P I --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--- === cp.apple.finalcutpro.main.KeywordEditor ===
---
--- Keyword Editor Module.
@latenitefilms
latenitefilms / MenuBar.lua
Created January 23, 2018 13:05
MenuBar Debugging
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- 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 January 23, 2018 08:21
Keywords Plugin Temp Fix
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- K E Y W O R D S P L U G I N --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--- === plugins.finalcutpro.browser.keywords ===
---
--- Browser Keywords
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)
--------------------------------------------------------------------------------
--
-- 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/
--