AppleScript X包含在术语列表中

时间:2017-05-23 12:53:41

标签: list applescript contains

我认为只需使用" "运营商会允许我检查一个变量," theMessage"包含" x"或" y"。显然不是。

我试过了:

else if theMessage contains {"display", "screen"} then
 --sleep computer's display
  do shell script "pm displaysleepnow"
  set theResponse to "Now sleeping the computer's display"

我可能会写很多这些,所以如果我能在术语中获得 term 的子程序,那就太棒了运营商......例如

if theMessage contains {....} not {....}

1 个答案:

答案 0 :(得分:0)

你必须使用重复循环,类似这样的

import { AVATARS } from './arrays'
import { STATS } from './arrays'

//returns data based on array position(num)
export function getAvatar(num) {
    return AVATARS['avatar' + num];
}

export function getStats(num) {
    return STATS['stats' + num];
}

并使用它

export var Characters = [
    {
        id: 1,
        Name: "Abe",
        HitPointValue: "124",
        StrengthValue: "12",
        IntelligenceValue: "14",
        WisdomValue: "16",
        DexterityValue: "12",
        ConstitutionValue: "10",
        CharismaValue: "17",
        Avatar: require('./images/avatar_7.jpg')
    },
    {
        id: 2,
        Name: "Jake",
        HitPointValue: "141",
        StrengthValue: "21",
        IntelligenceValue: "6",
        WisdomValue: "5",
        DexterityValue: "8",
        ConstitutionValue: "20",
        CharismaValue: "10",
        Avatar: require('./images/avatar_2.jpg')
    }
]