NSAppleScriptErrorNumber = -1708

发布于 2024-09-28 20:04:18 字数 141 浏览 2 评论 0原文

我正在尝试使用 Applescript 将图像附加到邮件应用程序。但在 10.5 上我收到

NSAppleScriptErrorNumber = -1708 错误。这个错误是什么意思?

有人可以指导我吗?

问候, 索米亚

I am trying to attach a Image to Mail application using Applescript. But on 10.5 I am getting

NSAppleScriptErrorNumber = -1708 error. What is this error means?

Can anybody guide me with this?

Regards,
Sowmya

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宛菡 2024-10-05 20:04:18

我写了一个 applescript 来告诉你错误代码的含义。在此处获取它。请参阅帖子 #9 以获取我发布的最新版本。

I wrote an applescript that tells you what the error codes mean. Get it here. Look in post #9 for the most recent version I posted.

弱骨蛰伏 2024-10-05 20:04:18

正如菲利普·里根所说。需要更多信息。

但我怀疑这是你对文件路径的构造。
我过去曾使用 NSAppleScript 将文件附加到邮件中。如果我没记错的话。我的应用程序将文件路径收集为 Unix 类型路径字符串。
即/Users/UserName/Documents/myFile.ext。

在 NSApplescript 脚本字符串中,我使用“POSIX file \"%@\") 作为别名”

NSString *scriptString= [NSString stringWithFormat:@"set theMailname to (POSIX file \"%@\") as alias\ntell application \"Mail\"\nset newMessage to make new outgoing message with properties{visible:true,subject:\"%@\", content:\"%@\"}\ntell newMessage\nset visible to false\n\nmake new to recipient at end of to recipients with properties {address:\"%@\"}\n  set theAddressFrom to \"%@\"\ntell content\nmake new attachment with properties {file name:theMailname} at after the last paragraph\nend tell\n save \nend tell\nend tell",fileStore,subject,body,theAddressTo,theAddressFrom];

fileStore 是转换为别名的文件的 unix 类型路径。

As Philip Regan says. More info needed.

But I suspect its your construction of the file paths.
I have used NSAppleScript in the past to attach files to mail. If I remember right. My app gathered the files path as a Unix type path string.
i.e /Users/UserName/Documents/myFile.ext.

And in the NSApplescript script string I use "POSIX file \"%@\") as alias"

NSString *scriptString= [NSString stringWithFormat:@"set theMailname to (POSIX file \"%@\") as alias\ntell application \"Mail\"\nset newMessage to make new outgoing message with properties{visible:true,subject:\"%@\", content:\"%@\"}\ntell newMessage\nset visible to false\n\nmake new to recipient at end of to recipients with properties {address:\"%@\"}\n  set theAddressFrom to \"%@\"\ntell content\nmake new attachment with properties {file name:theMailname} at after the last paragraph\nend tell\n save \nend tell\nend tell",fileStore,subject,body,theAddressTo,theAddressFrom];

fileStore being the unix type path of the file that is converted to an Alias.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文