2013-11-21 122 views
1

我知道這應該很容易,但我只是沒有找到它。我們有一個程序在Users/Shared /中自動創建一個新文件夾。該文件夾每次都是不同的名稱。這就是變量。Applescript文件夾操作使文件夾在新文件夾中?

我需要一個文件夾操作,將做到以下幾點:

當新的文件夾複製或創建用戶/共享/,

創建(或從另一個位置複製)兩個內線新新的文件夾一個名爲「To」的文件夾和一個名爲「From」的文件夾。

我試着「錄製」一個,但它什麼都沒做。

感謝您的幫助!

回答

2

嘗試:

on adding folder items to theFolder after receiving droppedItems 
    repeat with anItem in droppedItems 
     tell application "System Events" to get kind of (contents of anItem) = "Folder" 
     if the result then do shell script "mkdir -p " & (quoted form of (POSIX path of anItem)) & "{\"To\",\"From\"}" 
    end repeat 
end adding folder items to 
+0

哇!謝謝!那樣做了。我的頭撞在牆上太久了! – scottl31

+0

你好, 這是工作很好,當我設置它。當我拖動一個新文件夾時,它仍然會創建文件夾,或者執行cmd-shift-N,但是當用戶通過網頁界面創建一個新文件夾時,不再創建收件人/來源文件夾。 任何想法,爲什麼這將停止工作? 非常感謝, – scottl31

相關問題