【发布时间】:2019-09-12 17:58:27
【问题描述】:
我正在尝试为保管箱文件夹创建一个 applescript,以便在将新文件添加到文件夹时,它会自动将该文件添加到 iTunes 中的特定播放列表中(目标是能够更新多台计算机'只需将一个文件添加到一个保管箱文件夹即可远程播放列表。)
除了将文件添加到 iTunes 播放列表外,AppleScript 也可以使用。调试有点棘手,因为它是一个文件夹操作,所以它不能在脚本编辑器中运行。我一直在使用显示对话框来尝试了解正在发生的事情,但对话框显示的信息对我来说看起来像是正确的信息,所以我很难过。非常感谢任何帮助!
我尝试使用 POSIX 路径,我尝试将项目设置为别名,作为字符串,我尝试使用 "\"" & item & "\"" 将项目设置为另一个变量
set playlistToUpdate to "Public News Service"
on adding folder items to theFolder after receiving theNewItems
set filesAdded to {}
repeat with i from 1 to count of theNewItems
set thisItem to item i of theNewItems as alias
tell application "iTunes"
launch
delay 2
display dialog thisItem
add thisItem to playlist playlistToUpdate
end tell
end repeat
end adding folder items to
【问题讨论】:
标签: applescript dropbox itunes