Pdf Applescript在多个桌面上使用的可变文件夹位置

Pdf Applescript在多个桌面上使用的可变文件夹位置,pdf,applescript,acrobat,Pdf,Applescript,Acrobat,我是一个真正的新手,我能够通过从其他帖子中挑选一些片段来创建一个苹果脚本。此脚本使用acrobat pro 11引擎从文件夹批量打印PDF,并在完成后将其移动到单独的文件夹。。。而脚本在桌面路径固定的计算机上运行良好。它必须针对我们使用的每台不同的计算机进行修改。是否有办法在可变位置编写监视文件夹的脚本 property myFolder : "HD:Users:User:desktop:Print:" set myfiles to list folder myFolder without i

我是一个真正的新手,我能够通过从其他帖子中挑选一些片段来创建一个苹果脚本。此脚本使用acrobat pro 11引擎从文件夹批量打印PDF,并在完成后将其移动到单独的文件夹。。。而脚本在桌面路径固定的计算机上运行良好。它必须针对我们使用的每台不同的计算机进行修改。是否有办法在可变位置编写监视文件夹的脚本

property myFolder : "HD:Users:User:desktop:Print:"

set myfiles to list folder myFolder without invisibles

repeat with myfile in myfiles

    set mycurrentfile to ((myFolder as string) & (myfile as string)) as string
    batchprint(mycurrentfile)

end repeat

on batchprint(mycurrentfile)

    tell application "Adobe Acrobat Pro"
        activate -- bring up acrobat
        open alias mycurrentfile -- acrobat opens that new file    
        tell application "System Events"
            tell process "Acrobat"
                click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
                click button "Print" of window "Print"
                tell application "System Events"
                    tell process "Acrobat"
                        click menu item "Close" of menu 1 of menu bar item "File" of menu bar 1
                    end tell
                end tell
            end tell
        end tell
    end tell

    tell application "Finder" -- to move the printed file out 
        set x to (("HD:Users:User:desktop:Printed PDFs") as text)
        if alias x exists then
            beep
        else
            make new folder at the desktop with properties {name:"Printed PDFs"}
        end if
        move alias mycurrentfile to folder "Printed PDFs"
end tell


end batchprint

在AppleScript中,您可以使用指向桌面文件夹的路径引用当前用户的桌面文件夹 例如:


真是太棒了!。。。非常感谢。在脚本的第二部分中,创建第二个文件夹printed PDFsset x to path to desktop folder作为文本和打印的PDF应该如何工作,您能给我一些指导吗
set myFolder to (path to Desktop Folder as text) & "Print:"