From b864a95ba308e57b876fc6fb579c72360c750f6e Mon Sep 17 00:00:00 2001 From: mst-mkt <131662659+mst-mkt@users.noreply.github.com> Date: Sat, 30 Nov 2024 06:29:46 +0900 Subject: [PATCH] Fix custom actions to work in any language --- custom_actions.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_actions.go b/custom_actions.go index a21c797..86d62c5 100644 --- a/custom_actions.go +++ b/custom_actions.go @@ -137,8 +137,10 @@ func makeCustomActionsHeader() { var outputActionRegex = regexp.MustCompile(`(?:must)?[o|O]utput(?:OrClipboard)?\((.*?)\)`) var customActionsHeader strings.Builder customActionsHeader.WriteString("if ShortcutInput {\n") + customActionsHeader.WriteString(" @_cherri_empty_dictionary: dictionary\n") + customActionsHeader.WriteString(" const _cherri_dictionary_type_name = typeOf(_cherri_empty_dictionary)\n") customActionsHeader.WriteString(" const _cherri_inputType = typeOf(ShortcutInput)\n") - customActionsHeader.WriteString(" if _cherri_inputType == \"Dictionary\" {\n") + customActionsHeader.WriteString(" if _cherri_inputType == _cherri_dictionary_type_name {\n") customActionsHeader.WriteString(" const _cherri_input = getDictionary(ShortcutInput)\n") customActionsHeader.WriteString(" const _cherri_identifier = getValue(_cherri_input, \"cherri_functions\")\n") customActionsHeader.WriteString(" const _cherri_valid = number(_cherri_identifier)\n")