applescript将两种文件移动到不同的文件夹

applescript将两种文件移动到不同的文件夹,applescript,Applescript,您好,我正在尝试创建Applescript以执行以下操作: 在过去的一周里,我的硬盘上有几个jpg和eps文件。我有两个文件夹:矢量和图像。 几天后,我得到了几十个这样的混合文件,我必须手动选择并移动到相应的文件夹中 如何将.eps移到VECTOR文件夹和jpg移到IMAGES文件夹。 我对applescripting一无所知,所以我复制了其他脚本的一部分,并将其组合在一起: 运行时{input,parameters}-copy if theExtension is "eps" then

您好,我正在尝试创建Applescript以执行以下操作:

在过去的一周里,我的硬盘上有几个jpg和eps文件。我有两个文件夹:矢量和图像。 几天后,我得到了几十个这样的混合文件,我必须手动选择并移动到相应的文件夹中

如何将.eps移到VECTOR文件夹和jpg移到IMAGES文件夹。 我对applescripting一无所知,所以我复制了其他脚本的一部分,并将其组合在一起:

运行时{input,parameters}-copy

if theExtension is "eps" then
    set destination to ~/user/Desktop/VECTO
end if
    tell application "Finder"
        move anItem to destination
if theExtension is "jpg" then
    set destination to ~/user/Desktop/IMAGO
end if
    tell application "Finder"
        move anItem to destination
终点

当然这是错误的,但希望有人能帮我纠正这一点
Thnx

我假设您是从问题的措辞方式将其合并到自动机工作流中

on run {input, parameters} -- copy
    repeat with aFile in input
        tell application "Finder"
            if name extension of aFile is "eps" then
                move aFile to folder ((path to desktop as text) & "VECTO")
            else if name extension of aFile is "jpg" then
                move aFile to folder ((path to desktop as text) & "IMAGO")
            end if
        end tell
    end repeat 
end run
如果没有,您可以使用:

set myFiles to (choose file with multiple selections allowed)
repeat with aFile in myFiles
    tell application "Finder"
        if name extension of aFile is "eps" then
            move aFile to folder ((path to desktop as text) & "VECTO")
        else if name extension of aFile is "jpg" then
            move aFile to folder ((path to desktop as text) & "IMAGO")
        end if
    end tell
end repeat

第一个很好用!。现在是第二个问题,我有一个NAS驱动器,其中有相同名称的文件夹用于备份。如何使此脚本直接将文件复制到NAS驱动器?