【发布时间】:2013-01-10 10:04:30
【问题描述】:
我必须将文件复制到很多 U 盘。因此,我正在尝试给我写一个简短的小程序。我不熟悉applescript,所以如果有人能给我一些提示,那就太好了。
到目前为止我所拥有的:
10 个 USB 集线器
重命名棒的简短脚本。
现在我被困在将文件复制到每个连接的棒上:
property ignoredVolumes : {"Macintosh HD", "Time Machine Backups"}
set myPath to ("Macintosh HD:Users:myusername:USB-Stick") as string
tell application "System Events"
set rootVolume to disk item (POSIX file "/Volumes" as text)
set allVolumes to name of every disk item of rootVolume
repeat with aVolume in allVolumes
if aVolume is not in ignoredVolumes then
set name of disk item (path of rootVolume & aVolume) to "Stickname"
end if
end repeat
end tell
我现在需要做的是从 myPath 复制到每个连接的 USB-Stick。因为他们都有相同的名字,所以他们会在名字后面加上数字(Stickname,Stickname 1,Stickname 2,...)
所以我需要在我的循环中将复制命令添加到刚刚重命名的棒上。
希望有人能帮帮我。
【问题讨论】:
标签: applescript