如何将字符串数组传递到苹果脚本列表,以便可以在 Macos 上迭代这些值?
如果我有一个使用 swift 的数组,看起来像 var array = ["james", "tom", "luke"]
我怎样才能把这个数组转换成苹果脚本列表或能给我的东西能够使用数组中的值并使用苹果脚本对其进行迭代。
我当前的代码是
let applescriptToOpen = """
repeat with t in \(array)
tell application "Google Chrome"
print value of t
end tell
end repeat
"""
代码示例将不胜感激。
If I have an array using swift that looks like var array = ["james", "tom", "luke"]
how could I convert this array into an apple script list or something that would give me the ability to use the values from the array and iterate over them with apple script.
My current code is
let applescriptToOpen = """
repeat with t in \(array)
tell application "Google Chrome"
print value of t
end tell
end repeat
"""
A code example would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 AppleScript-ObjC 桥接器。
Use the AppleScript-ObjC bridge.