2014-01-08 122 views
0

我正在嘗試使用applescript創建文件夾結構。此代碼的偉大工程在當地,但是當我嘗試它,它會返回一個網絡驅動器上「無法獲取<>‘’應用‘查找測試’。在網絡驅動器上創建文件夾結構

這是我的代碼有

tell application "Finder" 
set campaignName to text returned of (display dialog "Please enter Campaign Name:" default answer "Campaign Name") 
tell application "Finder" to set currentDirectory to target of Finder window 1 
make new folder at currentDirectory with properties {name:campaignName} 
make new folder at folder campaignName with properties {name:"a-creative"} 
make new folder at folder "a-creative" of folder campaignName with properties {name:"a-assets-from-client"} 
make new folder at folder "a-creative" of folder campaignName with properties {name:"b-art-director-files"} 
make new folder at folder "a-creative" of folder campaignName with properties {name:"c-for-production"} 
make new folder at folder "a-creative" of folder campaignName with properties {name:"d-developer-notes"} 
make new folder at folder "b-art-director-files" of folder "a-creative" of folder campaignName with properties {name:"PSD"} 
make new folder at folder "b-art-director-files" of folder "a-creative" of folder campaignName with properties {name:"storyboard"} 
end tell 

我希望有人可以幫我找出我做錯了什麼在這裏我是新來使用AppleScript

謝謝

回答

0

試試這樣說:。!

tell application "Finder" 
    set campaignName to text returned of (display dialog "Please enter Campaign Name:" default answer "Campaign Name") 
    tell application "Finder" to set currentDirectory to target of Finder window 1 
    set projectFolderRoot to make new folder at currentDirectory with properties {name:campaignName} 

    set aCreativeRoot to make new folder at projectFolderRoot with properties {name:"a-creative"} 
    set bArtDirectorRoot to make new folder at aCreativeRoot with properties {name:"b-art-director-files"} 
    make new folder at aCreativeRoot with properties {name:"c-for-production"} 
    make new folder at aCreativeRoot with properties {name:"d-developer-notes"} 

    make new folder at bArtDirectorRoot with properties {name:"PSD"} 
    make new folder at bArtDirectorRoot with properties {name:"storyboard"} 
end tell 
+0

謝謝!這工作! – user3175104

+0

很酷,感謝您的反饋! – 2014-01-09 19:16:09

相關問題