Skip to content

Commit c5e569e

Browse files
committed
Remove script menu from context menu
1 parent eec4731 commit c5e569e

File tree

4 files changed

+4
-116
lines changed

4 files changed

+4
-116
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
5.1.2 (unreleased)
44
--------------------------
55

6+
### Improvements
7+
8+
- Remove the Script menu from the context menu.
9+
610

711

812
5.1.1 (705)

CotEditor/Resources/Localizables/Application/MainMenu.xcstrings

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,94 +2657,6 @@
26572657
}
26582658
}
26592659
},
2660-
"Script" : {
2661-
"localizations" : {
2662-
"cs" : {
2663-
"stringUnit" : {
2664-
"state" : "translated",
2665-
"value" : "Skript"
2666-
}
2667-
},
2668-
"de" : {
2669-
"stringUnit" : {
2670-
"state" : "translated",
2671-
"value" : "Skript"
2672-
}
2673-
},
2674-
"en-GB" : {
2675-
"stringUnit" : {
2676-
"state" : "translated",
2677-
"value" : "Script"
2678-
}
2679-
},
2680-
"es" : {
2681-
"stringUnit" : {
2682-
"state" : "translated",
2683-
"value" : "Script"
2684-
}
2685-
},
2686-
"fr" : {
2687-
"stringUnit" : {
2688-
"state" : "translated",
2689-
"value" : "Script"
2690-
}
2691-
},
2692-
"it" : {
2693-
"stringUnit" : {
2694-
"state" : "translated",
2695-
"value" : "Script"
2696-
}
2697-
},
2698-
"ja" : {
2699-
"stringUnit" : {
2700-
"state" : "translated",
2701-
"value" : "スクリプト"
2702-
}
2703-
},
2704-
"ko" : {
2705-
"stringUnit" : {
2706-
"state" : "translated",
2707-
"value" : "스크립트"
2708-
}
2709-
},
2710-
"nl" : {
2711-
"stringUnit" : {
2712-
"state" : "translated",
2713-
"value" : "Script"
2714-
}
2715-
},
2716-
"pl" : {
2717-
"stringUnit" : {
2718-
"state" : "translated",
2719-
"value" : "Skrypt"
2720-
}
2721-
},
2722-
"pt" : {
2723-
"stringUnit" : {
2724-
"state" : "translated",
2725-
"value" : "Script"
2726-
}
2727-
},
2728-
"tr" : {
2729-
"stringUnit" : {
2730-
"state" : "translated",
2731-
"value" : "Betik"
2732-
}
2733-
},
2734-
"zh-Hans" : {
2735-
"stringUnit" : {
2736-
"state" : "translated",
2737-
"value" : "脚本"
2738-
}
2739-
},
2740-
"zh-Hant" : {
2741-
"stringUnit" : {
2742-
"state" : "translated",
2743-
"value" : "指令碼"
2744-
}
2745-
}
2746-
}
2747-
},
27482660
"Select All" : {
27492661
"localizations" : {
27502662
"cs" : {

CotEditor/Sources/Document Window/Content View/EditorTextViewController.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,6 @@ final class EditorTextViewController: NSViewController, NSServicesMenuRequestor,
260260

261261
func textView(_ view: NSTextView, menu: NSMenu, for event: NSEvent, at charIndex: Int) -> NSMenu? {
262262

263-
// append Script menu
264-
if let scriptMenu = ScriptManager.shared.contextualMenu {
265-
let item = NSMenuItem()
266-
item.title = ""
267-
item.setAccessibilityLabel(String(localized: "Script", table: "MainMenu"))
268-
item.image = NSImage(systemSymbolName: "applescript.fill",
269-
accessibilityDescription: String(localized: "Script", table: "MainMenu"))
270-
item.toolTip = String(localized: "Script", table: "MainMenu")
271-
item.submenu = scriptMenu
272-
273-
menu.addItem(item)
274-
}
275-
276263
// add "Inspect Character" menu item if single character is selected
277264
if self.textView.selectsSingleCharacter == true {
278265
menu.insertItem(withTitle: String(localized: "Inspect Character", table: "MainMenu"),

CotEditor/Sources/Setting Managers/ScriptManager.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,6 @@ final class ScriptManager: NSObject, NSFilePresenter, @unchecked Sendable {
109109

110110
// MARK: Public Methods
111111

112-
/// Script menu for context menu.
113-
@MainActor var contextualMenu: NSMenu? {
114-
115-
let items = self.scriptMenu!.items
116-
.filter { $0.action != #selector(openScriptFolder) }
117-
118-
guard items.contains(where: { !$0.isSeparatorItem }) else { return nil }
119-
120-
let menu = NSMenu()
121-
menu.items = items.map { $0.copy() as! NSMenuItem }
122-
123-
return menu
124-
}
125-
126-
127112
/// Starts observing the scripts directory.
128113
///
129114
/// This method should be called only once.

0 commit comments

Comments
 (0)