Linking to Apple Notes

栏目: IT技术 · 发布时间: 4年前

内容简介:The Notes App on iOS and macOS is nothing but unassuming. In a very competitive space of digital note-taking, its main advantage is that it’s “already there.” In a recentThat is, until last week, when I finally sat down and worked out an arrangement of scr

The Notes App on iOS and macOS is nothing but unassuming. In a very competitive space of digital note-taking, its main advantage is that it’s “already there.” In a recent Anthropocene Review episode , John Green gave it three and a half stars, praising its handiness and ruefully noting that ”things in the Notes app have a way of not getting done.” I migrated to Notes from Evernote some time around 2015, and the only thing I could never get done was figuring out how to link to my notes from OmniFocus.

That is, until last week, when I finally sat down and worked out an arrangement of scripts that seems to work reasonably well on both on macOS (Mojave, cannot test on Catalina just yet) and iOS. Use them at your own risk:

When you run the Copy Note URL script or shortcut, it’ll produce something like below (also, yes, I’m speaking at ETE 2020 in the spring):

“ETE talk 2020”

shortcuts://run-shortcut?name=NoteURL&input=1579467960

Here’s what’s going on here. I’m using a special URL scheme for iOS Shortcuts that points to my “Open Note URL” shortcut. There’s no Shortcuts app for Mac (yet) so I saved a macOS script as an app bundle and “squatted” the shortcuts:// URL scheme. As you might have guessed, the input is some sort of Note identifier. After testing various options, I settled on using the note’s creation timestamp for several reasons:

  • I (and I’ll guess you too) never create more than one note per second.
  • Creation date never changes, so it’s reasonably future-proof.
  • Apple doesn’t publicly expose any other ID that’s guaranteed not to change and works across multiple devices.
  • Simple numeric format with no additional encoding.

I must admit, there are some “gotchas” with the scripts. Getting the note’s creation date in the first place was surprisingly tricky. The Notes App doesn’t expose any way to get a reference to the “current” note on neither macOS nor iOS, which means we have to jump through some hoops to get it. On iOS, I couldn’t find a better way than to search the Notes app by the shortcut’s input title. On macOS, it’s even worse: we have to navigate the potentially volatile UI hierarchy to get the highlighted title. The good news is, once you got the URL, the Open URL script is extremely straightforward and works well in my experience.

I did a lot of googling while working on my scripts, so wanted to highlight the two posts that have been most helpful:

Let me know on Twitter or via email below if you end up using the shortcut. I’d love feedback, especially ideas on how to make the Copy URL shortcut more robust.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

ACM图灵奖演讲集

ACM图灵奖演讲集

阿申豪斯特 / 苏运霖 / 电子工业出版社 / 2005-4 / 55.0

本书完整地收录了这些演讲,并配之以部分获奖者撰写的后记,旨在反映过去数年来这一领域中发生的变化。对任何一位计算机科学的历史与发展有兴趣的人来说,本书都极具收藏价值。  本文收录了自图灵奖开始颁发的1966年起到1985年这20年间图灵奖获得者在授奖大会上所做演讲的全文。由于在此期间有三次是把奖项同时授予两个人的,而其中有两次两位获奖者分别做了演讲,因此一共收录了22篇演讲稿。本书把这些演讲分为两大......一起来看看 《ACM图灵奖演讲集》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具