Run applescript from C

做~自己de王妃 提交于 2019-12-11 07:54:19

问题


How can I run an AppleScript from within an C commandline utility? Googling didn't work, it only gave me Objective-C solutions...

EDIT: Oops, I should have googled for 'run shell script C'...
Now i found the system() function...


回答1:


I would use the exec family of functions, which is safer than system:

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


来源:https://stackoverflow.com/questions/9957672/run-applescript-from-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!