Bob icon indicating copy to clipboard operation
Bob copied to clipboard

能否加个利用苹果自带词典功能?

Open QuanchaoSong opened this issue 3 years ago • 5 comments

我看现在的各个翻译源都是在线的,但是苹果系统本身是有翻译软件的,而且功能其实很强大。 Screen Shot 2021-05-18 at 5 49 47 PM 所以加个这个翻译源,把它作为默认,不挺好的吗?也避免了申请token的问题。当然,如果有人想用在线翻译,那就再配置token。

QuanchaoSong avatar May 18 '21 09:05 QuanchaoSong

苹果不会开放 API 的吧,不过可以调用 “聚焦搜索”,不知是否可行

0xhyperdan avatar May 18 '21 09:05 0xhyperdan

苹果不会开放 API 的吧,不过可以调用 “聚焦搜索”,不知是否可行

有:https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/DictionaryServicesProgGuide/access/access.html#//apple_ref/doc/uid/TP40006152-CH5-SW1

我最近太忙了,好多事情要做。否则我直接就加了。

QuanchaoSong avatar May 18 '21 13:05 QuanchaoSong

苹果不会开放 API 的吧,不过可以调用 “聚焦搜索”,不知是否可行

有:https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/DictionaryServicesProgGuide/access/access.html#//apple_ref/doc/uid/TP40006152-CH5-SW1

我最近太忙了,好多事情要做。否则我直接就加了。

期待

yuhaowin avatar Dec 11 '21 08:12 yuhaowin

苹果不会开放 API 的吧,不过可以调用 “聚焦搜索”,不知是否可行

有:https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/DictionaryServicesProgGuide/access/access.html#//apple_ref/doc/uid/TP40006152-CH5-SW1

我最近太忙了,好多事情要做。否则我直接就加了。

期待,现在怎么样了呀

dingangui avatar May 12 '22 16:05 dingangui

#!/usr/bin/swift import Foundation

if (CommandLine.argc < 2) { print("Usage: dictionary word") }else{ let argument = CommandLine.arguments[1] let result = DCSCopyTextDefinition(nil, argument as CFString, CFRangeMake(0, argument.count))?.takeRetainedValue() as String? print(result ?? "") }

save this as dict.swift swiftc dict.swift and run ./dict word

yuhaowin avatar Jun 14 '22 04:06 yuhaowin