简体   繁体   中英

How to pass an array of strings to an apple script list so the values can be iterated over on macos?

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.

Use the AppleScript-ObjC bridge.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM