Skip to content

Commit

Permalink
Timeline Batch Export Improvements
Browse files Browse the repository at this point in the history
- Check to see if the chosen Destination Preset actually exists in the menubar.
- Changed the `.editorconfig` to use spaces as the indent style to hopefully get around all the de-tab issues I've been having on my M1.
- Closes #2811
  • Loading branch information
latenitefilms committed Mar 16, 2022
1 parent dd8d632 commit e46bbad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -2,6 +2,6 @@
# Set default charset
[*.{js,htm,html,sass,css,lua,lp}]
charset = utf-8
# indent_style = space
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
28 changes: 27 additions & 1 deletion src/plugins/finalcutpro/export/batch/batch.lua
Expand Up @@ -579,7 +579,7 @@ function mod.getDestinationFolder()
return exportPath and pathToAbsolute(exportPath)
end

--- plugins.finalcutpro.export.batch.getDestinationFolder() -> string | nil
--- plugins.finalcutpro.export.batch.getDestinationPreset() -> string | nil
--- Function
--- Gets the destination preset.
---
Expand All @@ -606,6 +606,32 @@ function mod.getDestinationPreset()
end
end

--------------------------------------------------------------------------------
-- Make sure the Destination Preset actually exists in the menubar:
--------------------------------------------------------------------------------
if destinationPreset and destinationPreset ~= i18n("sendToCompressor") then
local doesExistInMenu = fcp.menu:findMenuUI({"File", "Share", function(menuItem)
local title = menuItem and menuItem:attributeValue("AXTitle")

--------------------------------------------------------------------------------
-- Remove the (default)…:
--------------------------------------------------------------------------------
if title and title:sub(-13) == " (default)…" then
title = title:sub(1, -14)
end
--------------------------------------------------------------------------------
-- Remove the …:
--------------------------------------------------------------------------------
title = tools.replace(title, "", "")

return title == destinationPreset
end})
if not doesExistInMenu then
destinationPreset = nil
config.set("batchExportDestinationPreset", nil)
end
end

--------------------------------------------------------------------------------
-- If there's no existing destination, then try use the Default Destination:
--------------------------------------------------------------------------------
Expand Down

0 comments on commit e46bbad

Please sign in to comment.