applescript - 基本的 iTunes AppleScript 问题
问题描述
感觉就像一个真正的骨头,只是想弄清楚如何让这个脚本从艺术家的选择中插入名称并将其放入专辑艺术家。
tell application "iTunes"
set theTracks to (item 1 of (get selection))
set theTracks to selection
repeat with theTrack in theTracks
set albumartist to artist of theTrack
end repeat
end tell
解决方案
像这样:
tell application "iTunes"
set theTracks to (item 1 of (get selection))
set theTracks to selection
repeat with theTrack in theTracks
set albumartist to artist of theTrack
set album artist of theTrack to albumartist -- the missing line
end repeat
end tell
在现实生活中,我可能会跳过中间变量并将这对行写成一行,如下所示:
set album artist of theTrack to (get artist of theTrack)
甚至更好:
tell theTrack to set album artist to (get artist)
推荐阅读
- reactjs - Mobx React 存储数组推送不需要的道具
- azure - 天蓝色管道 - PowerShell
- java - spring doc中的句子“......不适用于@Aspect模型中声明的方面”是什么意思?
- subset - 按日期变量子集数据(Stata)
- debugging - 在windbg脚本中'@@'是什么意思
- java - 如何使用注释修改 Java 类中的字段值?
- angular - Reactive Forms Angular 11v的动态字段内的动态字段
- python - AttributeError:模块“werkzeug.wrappers.request”没有属性“方法”
- c# - 如何模拟 iconfiguration.GetSection(MyNodeName).Get
() - python - 用于键盘输入监控的最佳 python 模块