更新时间:2023-11-23 08:08:22
您可以使用shell逐行获取所有歌曲名称的列表(这不是AppleScript列表).
You could use the shell to get a list with all song names line by line (this is not a AppleScript list).
set charts to (do shell script "
curl -s 'https://www.apple.com/itunes/charts/songs/'| tr '\"' '\n' |awk '/^ alt=$/ {getline;print}'")
tr '\"' '\n'
用新行替换双引号(tr手册页)
tr '\"' '\n'
substitutes the double quotes with new lines (tr manual page)
awk '/^ alt=$/ {getline;print}'
在alt=
行之后打印写有歌曲名称的行( awk手册页面)
awk '/^ alt=$/ {getline;print}'
prints the line after the line alt=
where the song name is written (awk manual page)