Documentation ¶
Index ¶
- Constants
- Variables
- func Dict(v *Var)
- func GetSysIconPath(name string) string
- func List(items []*Item)
- func Notice(title, content string)
- func Output(v interface{})
- func Row(title, subtitle string)
- type Alfredworkflow
- type Icon
- type IconType
- type Item
- type Mod
- type ModItem
- type ModKey
- type Response
- type Text
- type Var
Constants ¶
View Source
const ( ModKeyCmd = "cmd" // ⌘ ModKeyAlt = "alt" // ⌥ ModKeyOpt = "alt" // ⌥ ModKeyCtrl = "ctrl" // ^ ModKeyShift = "shift" // ⇧ ModKeyFn = "fn" // fn )
...
Variables ¶
View Source
var ( IconWorkflow = NewIcon("icon.png") IconAccount = NewIcon(GetSysIconPath("Accounts.icns")) IconBurn = NewIcon(GetSysIconPath("BurningIcon.icns")) IconClock = NewIcon(GetSysIconPath("Clock.icns")) IconColor = NewIcon(GetSysIconPath("ProfileBackgroundColor.icns")) IconColour = NewIcon(GetSysIconPath("ProfileBackgroundColor.icns")) IconEject = NewIcon(GetSysIconPath("EjectMediaIcon.icns")) IconError = NewIcon(GetSysIconPath("AlertStopIcon.icns")) IconFavorite = NewIcon(GetSysIconPath("ToolbarFavoritesIcon.icns")) IconFavourite = NewIcon(GetSysIconPath("ToolbarFavoritesIcon.icns")) IconGroup = NewIcon(GetSysIconPath("GroupIcon.icns")) IconHelp = NewIcon(GetSysIconPath("HelpIcon.icns")) IconHome = NewIcon(GetSysIconPath("HomeFolderIcon.icns")) IconInfo = NewIcon(GetSysIconPath("ToolbarInfo.icns")) IconNetwork = NewIcon(GetSysIconPath("GenericNetworkIcon.icns")) IconNote = NewIcon(GetSysIconPath("AlertNoteIcon.icns")) IconSettings = NewIcon(GetSysIconPath("ToolbarAdvanced.icns")) IconSwirl = NewIcon(GetSysIconPath("ErasingIcon.icns")) IconSwitch = NewIcon(GetSysIconPath("General.icns")) IconSync = NewIcon(GetSysIconPath("Sync.icns")) IconTrash = NewIcon(GetSysIconPath("TrashIcon.icns")) IconUser = NewIcon(GetSysIconPath("UserIcon.icns")) IconWarning = NewIcon(GetSysIconPath("AlertCautionIcon.icns")) IconWeb = NewIcon(GetSysIconPath("BookmarkIcon.icns")) )
... 预设图标
Functions ¶
Types ¶
type Alfredworkflow ¶
type Alfredworkflow struct { Arg string `json:"arg"` Config *Var `json:"config"` Variables *Var `json:"variables"` // 通过 {var:xxx} 使用 }
Alfredworkflow ...
type Item ¶
type Item struct { Uid string `json:"uid,omitempty"` // 唯一标识 Title string `json:"title"` // 主标题 Subtitle string `json:"subtitle,omitempty"` // 副标题 Arg string `json:"arg,omitempty"` // 传递的参数, 通过 {query} 访问 Icon *Icon `json:"icon,omitempty"` // 图标 Valid bool `json:"valid,omitempty"` // 是否有效, 默认 true, 无效时回车不执行任何操作 Match string `json:"match,omitempty"` // Filters Results Autocomplete string `json:"autocomplete,omitempty"` // Tab 健自动补全 Type string `json:"type,omitempty"` // 类型, 默认 default(default/file/file:skipcheck) Mods *Mod `json:"mods,omitempty"` // 控制按键回车时可变更 subtitle, icon, arg 等 Action interface{} `json:"action,omitempty"` // 定义 Universal Action, 类型 object/array/string Text *Text `json:"text,omitempty"` // 定义 cmd+c 复制和 cmd+l 显示时的文本 Quicklookurl string `json:"quicklookurl,omitempty"` // 快速预览, shift 或者 cmd+y, 无则使用 arg Variables *Var `json:"variables,omitempty"` // 传递的变量, 通过 {var:xxx} 访问 }
Item 对应 script filter 中的列表项
type ModItem ¶
type ModItem struct { Key string `json:"key,omitempty"` Subtitle string `json:"subtitle,omitempty"` Icon *Icon `json:"icon,omitempty"` Valid bool `json:"valid,omitempty"` Arg []string `json:"arg,omitempty"` Variables *Var `json:"variables,omitempty"` }
ModItem ...
type Response ¶
type Response struct { Rerun bool `json:"rerun,omitempty"` // 为 true 时再次执行(时间秒针变化) Skipknowledge bool `json:"skipknowledge,omitempty"` // xxx Variables map[string]string `json:"variables,omitempty"` // 设置变量, 可被 items 使用 Items []*Item `json:"items,omitempty"` // 输出列表 Alfredworkflow *Alfredworkflow `json:"alfredworkflow,omitempty"` // 输出变量 }
ScriptFilter 对应 Script Filter 组件返回 https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
Click to show internal directories.
Click to hide internal directories.