2013-10-03 54 views
2

這是我正在嘗試製作的腳本 我試圖做一個腳本來查看Fido_Data是否在我的桌面上用if和else語句存在,但由於某種原因它只是得到錯誤Finder得到一個錯誤:AppleEvent處理程序失敗。Apple腳本錯誤Finder得到一個錯誤:AppleEvent處理程序失敗

tell application "Finder" 
    if exists folder [homePath & "Desktop/Fido_Data"] then 
     set FidoFolderExists to "yes" 
    else 
     display dialog homePath & "Desktop/" 
     make new folder at [homePath & "Desktop/"] with properties {name:"Fido_Data"} 
    end if 
end tell 

回答

1

嘗試:

tell application "Finder" 
    if exists folder ((path to desktop as text) & "Fido_Data") then 
     set FidoFolderExists to "yes" 
    else 
     display dialog (path to desktop as text) 
     make new folder at (path to desktop) with properties {name:"Fido_Data"} 
    end if 
end tell