在 iOS 上使用 Safari、在 Mac OS 上使用 Chrome :信息联通问题的解决
在 iOS 上使用 Safari、在 Mac OS 上使用 Chrome :信息联通问题的解决
技术分享|2023-6-8|最后更新: 2023-6-8
 
date
Jun 8, 2023
type
Post
status
Published
slug
safari2chrome
summary
2023.6.8
tags
工具
workflow
category
技术分享
icon
password
之前写了一个从 Chrome 一键发送到 Safari 阅读列表的方法(回溯在最后)。 这里是想解决,在手机上看网页时,有些内容会希望能在 Mac OS 上处理,但这个信息不知道应该保存到哪里比较好。最自然的肯定是完全不用单独保存在其他软件中,而是下次打开电脑时, Chrome 会「自动打开」这些网页。尽管有许多第三方工具可以借用(甚至微信,但是日常操作时,不额外多任何一个步骤,能够完全无痛,是我的需求。
最早的时候, Pushbullet 是一个现成工具,但开发者不满 app store 的上架费用,已经退出 iOS 很久了(虽然但是……还是支持这个决策)。
解决方案是一共两步设置,设置好之后自动运行就行。
一共三个日常都在用的基本工具 Shortcut (iOS)、iCloud 和 Keyboard Maestro(Mac OS)。
操作如下。
 
 
1. 如下图,使用 Shortcut 在手机上设置一个快捷指令,完成目标
通过 shearsheet 的分享,将网页 url 保存到 iCloud 网盘,生成一个标题为 ReadLaterURL*.md 的文件。
分享了几次,就生成几个文件,按顺序编号。
Shortcut 可以直接用我写的:(不要改动设置)
https://www.icloud.com/shortcuts/c599050bff5a481b92b3fb4a97795809
 
notion image
 
2. 上一步生成的.md文件,会在打开 Mac 之后,立即自动同步到 Mac OS 上的 iCloud 文件夹中。
使用 Keyboard Maestro 设置一个触发,实现:一旦 iCloud 更新了含有此标题的 .md 文件,就自动打开这个 url, 打开之后随即删掉这些 .md 文件,不造成信息冗余。
这一步使用 apple script,在 KM 中设置如图:
注意,iCloud 文件的路径和上一步 Shortcut 保存的要一致。直接使用:~/Library/Mobile Documents/com~apple~CloudDocs(iCloud 在 Mac OS 上的根文件夹)
脚本可以直接复制:
-- Set the path to your iCloud folder where the ReadLaterURL files are savedset iCloudPath to POSIX path of (path to library folder from user domain as text) & "Mobile Documents/com~apple~CloudDocs/" -- Get a list of all the ReadLaterURL files in the iCloud folderset fileList to paragraphs of (do shell script "cd " & quoted form of iCloudPath & " && ls -1 ReadLaterURL*") -- Loop through the list of files and process each onerepeat with i from 1 to count fileList set thisFile to item i of fileList set filePath to iCloudPath & thisFile -- Read the URL from the file set theURL to do shell script "cat " & quoted form of filePath -- Open the URL in Chrome tell application "Google Chrome" activate open location theURL end tell -- Delete the file do shell script "rm " & quoted form of filePathend repeat
 
notion image
 
然后就可以用了。 痛点 -1。因为无缝,所以真的很爽(设置好的时候很爽!
真正用的时候确实没有感觉,很自然就完成就行。重点在于:网页信息被更好地在电脑上被连续上了,可以进行下一步的使用和处理了!
结束,下次见!
 

 
附:从 Chrome 一键保存当前网页到 Safari 阅读清单的 KM 设置
如下图。
notion image
 
202308 | 一去无消息,那能惜马蹄202304 | 工作计划