3

我有一组 Ableton Live 文件(扩展名“.als”),我需要在播放节目时循环浏览这些文件。我想专门使用一个键盘快捷键来启动每个快捷键,并打算为此使用 AppleScript。

问题是每个文件在我播放相关歌曲的过程中都会发生变化,因此当我按下键盘快捷键启动与我的集合中的下一首歌曲关联的 .als 时,Ableton 会打开“关闭前保存更改?” 对话框(此时我想要做的是选择“不保存”)。

此时只需按 command + D 就可以了,但我真的很想自动化这个按键。我似乎无法弄清楚如何让 applescript 做到这一点。我是一个 AppleScript 菜鸟,点击 AS 中的“打开字典”选项似乎表明 Ableton 不是正式的可编写脚本的应用程序。

对此有什么想法吗?这是我一直在尝试的 AppleScript 示例。这将启动在我的设置列表中打开下一个 .als 的过程,但不会单击“不保存”按钮。

tell application "Finder"
activate
open document file "Song 1.als" of folder "Desktop" of folder "User" of folder "Users" of startup disk
end tell
tell application "System Events"
keystroke "d" using command down
end tell
4

2 回答 2

1

有趣的!

最后遇到了使它起作用的提示:

  • 将 Script Editor 和 Ableton Live 添加到 Accessibility API:System Preferences > Security & Privacy > Privacy...
  • 忽略应用程序响应以在对话期间继续执行脚本。

LiveLoader.scpt:

-- open file
ignoring application responses -- don't wait for user input
    tell application "Ableton Live 9 Suite" to open "Users:username:Desktop:LiveSet Project:LiveSet.als"
end ignoring

-- use delay if needed
-- delay 0.5

-- skip saving file
tell application "System Events"
    set frontmost of process "Live" to true
    key code 123 -- left
    key code 123 -- left
    keystroke return -- enter
end tell


注意:
考虑可能的安全影响。
也许只是在使用后禁用隐私列表中的应用程序。(可以编写脚本;)

现在还可以发送鼠标点击,以获得更多创意。:)

于 2015-06-25T15:21:22.547 回答
0

我知道这是旧的。但为了帮助可能发现自己在这里的其他人......这就是我所做的。

使用名为 Qlab 的程序。免费版本会很好。制作一个applescript Cue。转到“触发器”选项卡。选择 MIDI 触发器。点击您也想分配命令的 midi 键。这个提示现在将在它收到这个 MIDI 音符时启动 - 即使在后台运行时也是如此。转到“脚本”选项卡。复制并粘贴下面的脚本。

您可以对每首歌曲进行相关调整。基本上每个键都会关闭所有当前的ableton文件而不保存 - 按要求。然后启动特定的现场设置。您分配了哪一个。在这种情况下,歌曲“Less Than Nothing”

编码...

tell application "System Events"
    set frontmost of process "Live" to true
    keystroke "q" using command down
    tell application "System Events" to keystroke (ASCII character 28) --left arrow
    tell application "System Events" to keystroke (ASCII character 28) --left arrow
    keystroke return
end tell
delay 2.0
do shell script "open '/Users/CamMac/Desktop/Less Than Nothing 2 .als' "
于 2017-02-18T16:35:57.743 回答