diff --git a/CHANGELOG.md b/CHANGELOG.md index 49db9ea9d3..06bb1f9a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Improvements +- Add .awk extension to file types treaded as CotEditor script. - Adjust the layout of the file preview view. - Update the Swift syntax to add `@Test` and `@Suite` attributes. diff --git a/CotEditor/Info.plist b/CotEditor/Info.plist index 0f257818ca..3d96f635af 100644 --- a/CotEditor/Info.plist +++ b/CotEditor/Info.plist @@ -230,6 +230,30 @@ + + UTTypeConformsTo + + public.script + + UTTypeDescription + AWK script + UTTypeIcons + + UTTypeIconBackgroundName + CurlyBrackets-fill + UTTypeIconText + config + + UTTypeIdentifier + com.coteditor.awk + UTTypeTagSpecification + + public.filename-extension + + awk + + + UTTypeConformsTo diff --git a/CotEditor/Resources/CotEditor.help/Contents/Resources/en.lproj/pgs/script_unixscript.html b/CotEditor/Resources/CotEditor.help/Contents/Resources/en.lproj/pgs/script_unixscript.html index bce49b78af..72acdc24d1 100644 --- a/CotEditor/Resources/CotEditor.help/Contents/Resources/en.lproj/pgs/script_unixscript.html +++ b/CotEditor/Resources/CotEditor.help/Contents/Resources/en.lproj/pgs/script_unixscript.html @@ -16,7 +16,7 @@

Script CotEditor with UNIX script

This page explains how to pass your document’s text to UNIX scripts that are executable from the Script menu, or how to receive the outputs from them.

diff --git a/CotEditor/Resources/CotEditor.help/Contents/Resources/ja.lproj/pgs/script_unixscript.html b/CotEditor/Resources/CotEditor.help/Contents/Resources/ja.lproj/pgs/script_unixscript.html index f13f3d1380..fc35239f07 100644 --- a/CotEditor/Resources/CotEditor.help/Contents/Resources/ja.lproj/pgs/script_unixscript.html +++ b/CotEditor/Resources/CotEditor.help/Contents/Resources/ja.lproj/pgs/script_unixscript.html @@ -16,7 +16,7 @@

CotEditorをUNIXスクリプトで操作する

このページではスクリプトメニューから実行するUNIXスクリプトにCotEditorで編集中の書類の情報やテキストを渡したり、スクリプトの実行結果を書類に反映する方法を説明します。

diff --git a/CotEditor/Resources/Localizables/InfoPlist.xcstrings b/CotEditor/Resources/Localizables/InfoPlist.xcstrings index 03530b2a75..7d4cb01cd9 100644 --- a/CotEditor/Resources/Localizables/InfoPlist.xcstrings +++ b/CotEditor/Resources/Localizables/InfoPlist.xcstrings @@ -1,6 +1,94 @@ { "sourceLanguage" : "en", "strings" : { + "AWK script" : { + "localizations" : { + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK skript" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK-Skript" + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK script" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Script AWK" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Script AWK" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Script AWK" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWKスクリプト" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK 스크립트" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK-script" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "skrypt AWK" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "Script AWK" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK betiği" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK脚本" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "AWK腳本" + } + } + } + }, "BibTeX bibliography" : { "localizations" : { "cs" : { diff --git a/CotEditor/Sources/Models/Scripts/ScriptDescriptor.swift b/CotEditor/Sources/Models/Scripts/ScriptDescriptor.swift index a9ca04f5bc..0232aabc74 100644 --- a/CotEditor/Sources/Models/Scripts/ScriptDescriptor.swift +++ b/CotEditor/Sources/Models/Scripts/ScriptDescriptor.swift @@ -27,6 +27,12 @@ import Foundation import UniformTypeIdentifiers import Shortcut +private extension UTType { + + static let awkScript = UTType(exportedAs: "com.coteditor.awk") +} + + enum ScriptingFileType: CaseIterable { case appleScript @@ -37,7 +43,7 @@ enum ScriptingFileType: CaseIterable { switch self { case .appleScript: [.appleScript, .osaScript, .osaScriptBundle] // .applescript, .scpt, .scptd - case .unixScript: [.shellScript, .perlScript, .phpScript, .rubyScript, .pythonScript, .javaScript, .swiftSource] + case .unixScript: [.shellScript, .perlScript, .phpScript, .rubyScript, .pythonScript, .javaScript, .awkScript, .swiftSource] } } }