在 iOS 上使用 Safari、在 Mac OS 上使用 Chrome :信息联通问题的解决
之前写了一个从 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](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fa4e18ca8-3e6b-4a31-ae15-02631fe41403%2F71e93928-dc3c-4efc-9ea0-ce176e402947%2F5881686233665_.pic.jpg%3Fid%3D222a0be8-d8b2-4985-bdb1-e9b9ce13b22a%26table%3Dblock%26spaceId%3Da4e18ca8-3e6b-4a31-ae15-02631fe41403%26expirationTimestamp%3D1722024000000%26signature%3DQqMu2JkB0CZZIjPNWsPCn-dnVZo_FyTQEo4C_bEv3G4?table=block&id=222a0be8-d8b2-4985-bdb1-e9b9ce13b22a&cache=v2)
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](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fa4e18ca8-3e6b-4a31-ae15-02631fe41403%2F269c0ebe-1ddd-4165-9e9e-3e62fb36522b%2FCleanShot_2023-06-08_at_22.29.592x.jpg%3Fid%3D21b60c48-970e-4ac0-a7e5-f8afca8ee705%26table%3Dblock%26spaceId%3Da4e18ca8-3e6b-4a31-ae15-02631fe41403%26expirationTimestamp%3D1722024000000%26signature%3DL8lJJoxWv0cx7N_pIM5Cbs4-sANup6dF39ruY9cHKiM?table=block&id=21b60c48-970e-4ac0-a7e5-f8afca8ee705&cache=v2)
然后就可以用了。
痛点 -1。因为无缝,所以真的很爽(设置好的时候很爽!
真正用的时候确实没有感觉,很自然就完成就行。重点在于:网页信息被更好地在电脑上被连续上了,可以进行下一步的使用和处理了!
结束,下次见!
附:从 Chrome 一键保存当前网页到 Safari 阅读清单的 KM 设置
如下图。
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fa4e18ca8-3e6b-4a31-ae15-02631fe41403%2Fc2c38c07-677d-4b3c-9db0-90a3c120654e%2FCleanShot_2023-06-08_at_22.21.522x.jpg%3Fid%3D3ad5370d-280b-4cd0-a96a-268782ce2a53%26table%3Dblock%26spaceId%3Da4e18ca8-3e6b-4a31-ae15-02631fe41403%26expirationTimestamp%3D1722024000000%26signature%3DKtFJadRY30Sp-DFJ9nFnQqM72-F1qxxleJ8tmqr4Pcw?table=block&id=3ad5370d-280b-4cd0-a96a-268782ce2a53&cache=v2)