首先,我是Applescript的新手,所以请多多包涵。
我目前在Dropbox文件夹中有一个纯文本文件。该文件设置为填充文本(并且仅填充文本)。我正在尝试创建一个Automator工作流程(或Applescript脚本),该工作流程将从文本文件中读取内容,并将内容写入剪贴板。这样,我可以在iOS设备上复制文本,将其粘贴到Dropbox的纯文本文件中,然后使用mac(和此脚本)将文本粘贴到mac。基本上,使用Dropbox在OS X和iOS之间同步剪贴板。
我想Applescript不能超过几行,但是我还没有找到编写它的正确方法。任何帮助表示赞赏!
set the_file to choose file
set the_text to (do shell script "cat " & quoted form of (POSIX path of the_file))
set the clipboard to the_text
或者仅使用AS:
set the_file to choose file
set the clipboard to (read the_file)
(第二段代码End of file
对某些文件为我抛出错误,我不确定为什么,所以我将使用第一个)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句