<commit_before>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                         M E N U    A C T I O N                             --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

--- A `action` which will trigger an FCPX menu with a matching path, if available/enabled.
--- The plugin registers itself with the `cp.plugins.actions.actionmanager`.

--------------------------------------------------------------------------------
-- EXTENSIONS:
--------------------------------------------------------------------------------
local fnutils			= require("hs.fnutils")

local choices			= require("cp.choices")
local fcp				= require("cp.finalcutpro")

--------------------------------------------------------------------------------
-- CONSTANTS:
--------------------------------------------------------------------------------
local ID				= "menu"

--------------------------------------------------------------------------------
-- THE MODULE:
--------------------------------------------------------------------------------
local mod = {}

	function mod.id()
		return ID<commit_msg>#362 * Added the ‘enabled’ functions back into `menuaction` after merge.<commit_after>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--                         M E N U    A C T I O N                             --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

--- A `action` which will trigger an FCPX menu with a matching path, if available/enabled.
--- The plugin registers itself with the `cp.plugins.actions.actionmanager`.

--------------------------------------------------------------------------------
-- EXTENSIONS:
--------------------------------------------------------------------------------
local fnutils			= require("hs.fnutils")

local choices			= require("cp.choices")
local fcp				= require("cp.finalcutpro")
local metadata			= require("cp.metadata")

--------------------------------------------------------------------------------
-- CONSTANTS:
--------------------------------------------------------------------------------
local ID				= "menu"

--------------------------------------------------------------------------------
-- THE MODULE:
--------------------------------------------------------------------------------
local mod = {}

	function mod.setEnabled(value)
		metadata.set("menuActionEnabled", value)
		mod._manager.refresh()
	end

	function mod.isEnabled()
		return metadata.get("menuActionEnabled", true)
	end

	function mod.toggleEnabled()
		mod.setEnabled(not mod.isEnabled())
	end

	function mod.id()
		return ID
{'fraction_non_alphanumeric': 0.586436170212766, 'fraction_numerical': 0.0009973404255319148, 'mean_word_length': 0.4955268389662028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6605547', 'n_tokens_mistral': 495, 'n_tokens_neox': 465, 'n_words': 136}