gpt4 book ai didi

c - 从 C 运行 applescript

转载 作者:太空宇宙 更新时间:2023-11-04 02:14:13 25 4
gpt4 key购买 nike

如何从 C 命令行实用程序中运行 AppleScript?谷歌搜索没有用,它只给了我 Objective-C 解决方案...

编辑:哎呀,我应该在谷歌上搜索“运行 shell 脚本 C”...
现在我找到了 system() 函数...

最佳答案

我会使用 exec 系列函数,它比 system 更安全:

int exitCode = execlp("osascript", "osascript", "-e", "say \"Hello World\"", NULL);

关于c - 从 C 运行 applescript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9957672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com