如何在Ableton Live中使用AppleScript地址对话框?
我有一个Ableton Live文件的集合(扩展名“.als”),我需要在播放节目时循环浏览这些文件。我想用一个键盘快捷键来启动每一个,并打算使用AppleScript来实现这一点 问题是,在播放相关歌曲的过程中,每个文件都会发生更改,因此当我按下键盘快捷键启动与我的音乐集中下一首歌曲相关的.als时,Ableton会打开“关闭前保存更改?”对话框(此时我要做的是选择“不保存”) 在这一点上只需按command+D就可以了,但我真的很想自动按下这个键。我似乎不知道如何让applescript来做这件事。我是一个applescript noob,在AS中单击“打开字典”选项似乎表明Ableton不是一个正式的可编写脚本的应用程序 有什么想法吗?下面是一个我一直在尝试的AppleScript示例。这将启动打开集合列表中的下一个.als的过程,但不会单击“不保存”按钮 有趣 最后,我发现了一些让它起作用的技巧:如何在Ableton Live中使用AppleScript地址对话框?,applescript,ableton-live,Applescript,Ableton Live,我有一个Ableton Live文件的集合(扩展名“.als”),我需要在播放节目时循环浏览这些文件。我想用一个键盘快捷键来启动每一个,并打算使用AppleScript来实现这一点 问题是,在播放相关歌曲的过程中,每个文件都会发生更改,因此当我按下键盘快捷键启动与我的音乐集中下一首歌曲相关的.als时,Ableton会打开“关闭前保存更改?”对话框(此时我要做的是选择“不保存”) 在这一点上只需按command+D就可以了,但我真的很想自动按下这个键。我似乎不知道如何让applescript来做
- 将脚本编辑器和Ableton Live添加到辅助功能API: 系统首选项>安全和隐私>隐私
- 忽略应用程序响应以在对话框中继续脚本
-- 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
注:
考虑可能的安全影响。br> 可能只是在使用后禁用隐私列表中的应用程序。(可以编写脚本;)
现在还可以发送鼠标点击,以获得更多创意。:) 我知道这已经很旧了。但是为了帮助那些可能在这里找到自己的人。。。这就是我所做的 使用程序调用Qlab。免费版就可以了。 做一个苹果笔迹提示。转到“触发器”选项卡。选择midi触发器。按midi键也可以指定命令。这个提示现在会在收到这个midi音符时启动,即使是在后台运行。 转到“脚本”选项卡。复制并粘贴下面的脚本 您可以对每首歌曲进行相关调整。基本上,每个键都会关闭所有当前的ableton文件,而不会按要求保存。然后启动一个特定的直播集。哪一个是你分配的。在这种情况下,歌曲“少于零” 代码
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' "
也许我应该说,我当然也愿意选择自动机解决方案。
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' "