Applescript 苹果脚本递增变量

Applescript 苹果脚本递增变量,applescript,Applescript,您好,我正在尝试创建并应用脚本在剧院提示软件“Qlab”中运行 tell application id "com.figure53.qlab.3" set cueChannel to 16 set cueControlChangeNumber to 16 set cueControlValue to 0 make type "MIDI" set newCue to last item of (selected as list) set chan

您好,我正在尝试创建并应用脚本在剧院提示软件“Qlab”中运行

tell application id "com.figure53.qlab.3" 
    set cueChannel to 16
    set cueControlChangeNumber to 16
    set cueControlValue to 0

    make type "MIDI"
    set newCue to last item of (selected as list)
    set channel of newCue to cueChannel
    set q name of newCue to DiGiCo
    set command of newCue to control_change
    set byte one of newCue to cueControlChangeNumber
    set byte two of newCue to cueControlValue
end tell
我需要做的是“字节2”从0开始,增加1,最大值为127

每次都需要单独运行此脚本


有什么想法吗?

是的,您使用了重复块。不确定每次迭代需要重复多少代码

tell application id "com.figure53.qlab.3" 
    set cueChannel to 16
    set cueControlChangeNumber to 16

    repeat with cueControlValue from 0 to 127
        make type "MIDI"
        set newCue to last item of (selected as list)
        set channel of newCue to cueChannel
        set q name of newCue to DiGiCo
        set command of newCue to control_change
        set byte one of newCue to cueControlChangeNumber
        set byte two of newCue to cueControlValue
    end
end tell