Sketch-Find-And-Replace 插件使用教程
项目目录结构及介绍
Sketch-Find-And-Replace/
├── README.md
├── sketch-find-and-replace.sketchplugin
│ ├── Contents
│ │ ├── Resources
│ │ │ └── icon.png
│ │ └── Sketch
│ │ ├── manifest.json
│ │ └── script.js
├── LICENSE
└── .github
└── ISSUE_TEMPLATE
└── bug_report.md
- README.md: 项目介绍文件,包含项目的基本信息和使用说明。
- sketch-find-and-replace.sketchplugin: 插件的主要文件夹,包含插件的所有内容。
- Contents: 插件内容文件夹。
- Resources: 资源文件夹,包含插件的图标。
- Sketch: Sketch 插件的核心文件夹。
- manifest.json: 插件的配置文件,包含插件的基本信息和入口点。
- script.js: 插件的主要脚本文件,包含插件的逻辑代码。
- Contents: 插件内容文件夹。
- LICENSE: 项目的许可证文件。
- .github: GitHub 相关文件夹,包含 issue 模板。
- ISSUE_TEMPLATE: Issue 模板文件夹。
- bug_report.md: 提交 bug 报告的模板。
- ISSUE_TEMPLATE: Issue 模板文件夹。
项目的启动文件介绍
插件的启动文件是 sketch-find-and-replace.sketchplugin/Contents/Sketch/script.js
。这个文件包含了插件的主要逻辑代码,当用户在 Sketch 中执行插件时,会首先运行这个脚本。
项目的配置文件介绍
插件的配置文件是 sketch-find-and-replace.sketchplugin/Contents/Sketch/manifest.json
。这个文件包含了插件的基本信息和配置,例如插件的名称、版本、作者、入口点等。
{
"name": "Find and Replace",
"description": "Sketch plugin to do a find and replace on text within layers",
"author": "Thierry Charbonnel",
"homepage": "https://github.com/thierryc/Sketch-Find-And-Replace",
"version": "2.6.0",
"identifier": "com.thierryc.sketch.find-and-replace",
"appcast": "https://api.sketchpacks.com/v1/plugins/com.thierryc.sketch.find-and-replace/appcast",
"commands": [
{
"name": "Find and Replace",
"identifier": "find-and-replace",
"script": "script.js",
"shortcut": "cmd option shift f"
}
],
"menu": {
"title": "Find and Replace",
"items": [
"find-and-replace"
]
}
}
- name: 插件的名称。
- description: 插件的描述。
- author: 插件的作者。
- homepage: 插件的主页。
- version: 插件的版本。
- identifier: 插件的唯一标识符。
- appcast: 插件的更新信息。
- commands: 插件的命令列表。
- name: 命令的名称。
- identifier: 命令的唯一标识符。
- script: 命令对应的脚本文件。
- shortcut: 命令的快捷键。
- menu: 插件在 Sketch 菜单中的显示信息。
- title: 菜单项的标题。
- items: 菜单项对应的命令标识符。