我是AppleScript的新手,我正试图解决这个问题。
我正在尝试为电子邮件添加附件,我可以
添加图像tell msg to make new attachment with properties {file name:"/Users/jarrod/Library/img/image.png"} at after the last paragraph
但我希望脚本是动态的,并且可以在其他计算机上运行,所以我尝试了
tell msg to make new attachment with properties {file name:"~/Library/img/image.png"} at after the last paragraph
但是无法找到图片...
如果我粘贴路径并在浏览器中搜索它,则会出现... 〜/资源库/ IMG / image.png
有人请告诉我为什么这不起作用,或者你知道如何解决AppleScript中的用户文件夹名称。
答案 0 :(得分:1)
您可以设置如下路径:
set myPath to POSIX path of (path to library folder from user domain) & "img/image.png"