Apple Script增加变量

时间:2015-12-22 23:28:39

标签: applescript

您好我正在尝试创建和AppleScript在影院Cueing软件中运行' 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

我需要做的是第二个字节'从0开始并增加1到最大值127.

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

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

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

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