跳过正文
  1. Posts/

如何制作 Send to 2Do 的 Safari 书签

目录

使用鼠标拖拽下面这个链接到你的 Favorites Bar 上,默认点击行为实际上是模拟在当前页面进行导航,而目标地址由 avascript:window.location 来指定,目标地址实际上就是各个 App 的 URL Scheme。 你可以在 AppTalk查看各个主流 App 的 URL Scheme。

2Do
#

Send to 2Do

然后编辑地址,将其替换为如下:

javascript:window.location='twodo://x-callback-url/add?task='+encodeURIComponent(document.title)+'&note='+encodeURIComponent(window.location)+'&action=url:'+encodeURIComponent(window.location)
Change Value

所以,本质上是执行了一段 JS 代码,结合当前文档的上下文信息,调用 URL Scheme,其中

  1. document.title 为标题
  2. window.location 为当前页面链接

Things
#

我们知道 Things 的 URL Scheme 的规则如下:

/// add a todo due when tomorrow
things:///add?title=iamtitle&notes=iamnotes&when=tomorrow

Add a todo to Things

比如你可以把链接内容改为支持 Send To Things:

javascript:window.location='things:///add?title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(window.location)+'&when=today'

OmniFocus
#

同理,可以有 Send To OmniFocus ,如下:

javascript:window.location='omnifocus:///add?note='+encodeURIComponent(window.location)+'&name='+encodeURIComponent(document.title)

Add a todo to OmniFocus

或者直接去 OmniFocus 页面 用相同方式把起已经设置好正确 Value 的链接拖到上方工具条上即可。

如果你找不到 Favorites Bar,点击 Safari 菜单栏上的 View 菜单就能看到(中文系统叫视图)

Favorites Bar

相关文章

那些我恢复 Mac 系统之后要安装的 Apps

·5 分钟
记录一下自己常用的 Mac Apps,每次重装之后到了用的时候发现忘记安装了(不是每次都用 TimeMachine 恢复),而且强烈简易大家如果某个 App 有对应的独立安装版本的话,购买其独立安装版本为好,沙盒环境以及和 Apple ID 绑定的特性就使得功能性以及灵活度大减。

阅读流程

最近统一了一下自己的阅读流程,更新一下,具体用到的工具有 DEVONThink Pro PDFExpert MarginNote 其中 1 是输入和归档源,3 是输出源。 大概就是如下所示:

避免在 Swift 中使用单例

原文:Avoiding singletons in Swift 原作者 & Copyright @johnsundell “我知道单例不好,但是…”,这是开发者常常在讨论代码的时候会提到的。貌似社区大家有共识 ── 单例不好。但是同时,包括 Apple 和第三方的 Swift 开发者还是在 App 内部或者共享的 frameworks 里不断在用它们。

Swift 中几种不同的依赖注入方式

·5 分钟
原文:Different flavors of dependency injection in Swift 原作者 & Copyright @johnsundell 在之前的几篇博客中,我们已经了解了几种使用依赖注入方式使得某个 swift app 拥有一个更加解耦可测试的架构。比如在 在 Swift 中使用工厂模式进行依赖注入 中和工厂模式结合,以及在避免在 Swift 中使用单例中替换程序中的单例对象等方式进行依赖注入。

What is LLVM

什么是 LLVM?隐藏在 Swift,Rust,Clang 等语言背后的奥秘 # 了解编译器是如何生成机器原生代码会使得倒腾新语言或者加强已经存在的编程语言变得比以往更加容易了。