我需要一个脚本,将音乐文件从我的USB音乐文件夹移动到“自动添加到iTunes”文件夹中,然后播放该文件。这就是我到目前为止所做的:
tell application "Finder"
move items from "LEXAR:Pictures:Music:" to "Macintosh HD:User:" --this is where i'm lost, i need the path that doesnt include my name as the User
--and i need some way to tell itunes to play that file
抱歉奇怪的代码设置。我想要发生的是我将USB插入某人的计算机,点击此脚本作为.app,然后将“我的USB”中的文件传输到“自动添加到iTunes”,然后启动iTunes,播放那个音乐文件。
答案 0 :(得分:0)
您可以使用:
tell application "Finder"
set userPath to (path to home folder as text)
set directoryPath to "Music:iTunes:iTunes Media:Automatically Add to iTunes"
set fullPath to userPath & directoryPath
move every file of folder "LEXAR:Pictures:Music:" to folder fullPath
end tell
然后使用该变量以访问当前登录用户的主文件夹。从那里,您可以参考自动添加到iTunes文件夹:)