从C运行的AppleScript [英] Run applescript from C
本文介绍了从C运行的AppleScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何从Ç命令行工具中运行AppleScript?
谷歌搜索没有工作,只给了我的目标的-C解决方案...
How can I run an AppleScript from within an C commandline utility? Googling didn't work, it only gave me Objective-C solutions...
编辑:
哎呀,我应该用Google搜索运行shell脚本C'......结果
现在我找到了系统()
函数...
推荐答案
我会使用 EXEC
系列的功能,这比系统安全
:
I would use the exec
family of functions, which is safer than system
:
int exitCode = execlp("osascript", "osascript", "-e", "say \"Hello World\"", NULL);
这篇关于从C运行的AppleScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文