【发布时间】:2017-12-01 01:23:59
【问题描述】:
在 BBEdit 和 AppleScript 中,我可以遍历一个字符串并将该字符串设置到剪贴板:
set the clipboard to jsonString
然后我可以创建一个新的文本文档并将其保存:
set jsonParseFile to (name of project window 1) as text
save text document jsonParseFile to file ("some:location") without saving as stationery
set jsonParseFile to (name of active document of project window 1) as string
但是当我尝试使用paste 粘贴字符串的内容时,我收到一个错误,表明paste 不被理解:
BBEdit 出错:活动文档不理解“粘贴” 消息。
所以当我删除时:
set jsonParseFile to (name of active document of project window 1) as string
并使用:
paste of active document
我得到了同样的错误,但是当我只使用 paste 时,我返回了以下错误:
BBEdit got an error: Can't continue paste.
如何将字符串粘贴到文件变量jsonParseFile 中,这是最前面的文件而不调用:
tell active document of project window 1 to paste
而是用类似的东西:
tell active document of file jsonParseFile to paste
通过jsonParseFile?当我搜索时,除了击键之外我没有找到任何东西,我不想使用,当我检查字典以获取答案时,我没有得到太多:
【问题讨论】:
标签: applescript document paste bbedit