Applescript Apple脚本错误查找程序出错:AppleeEvent处理程序失败
这是我正在尝试制作的脚本 我正试图用if和else语句创建一个脚本,以查看我的桌面上是否存在Fido_数据,但由于某种原因,它只是得到了错误查找程序得到了一个错误:AppleEvent处理程序失败Applescript Apple脚本错误查找程序出错:AppleeEvent处理程序失败,applescript,Applescript,这是我正在尝试制作的脚本 我正试图用if和else语句创建一个脚本,以查看我的桌面上是否存在Fido_数据,但由于某种原因,它只是得到了错误查找程序得到了一个错误:AppleEvent处理程序失败 tell application "Finder" if exists folder [homePath & "Desktop/Fido_Data"] then set FidoFolderExists to "yes" else display
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
尝试:
在10.10.5中,我偶然发现finder文件存在错误的间歇性案例。我建议:
-- ------------------------------------------------------
(*
Philip Regan
https://stackoverflow.com/questions/3469389/applescript-testing-for-file-existence
*)
on fileExists(theFile) -- (String) as Boolean
tell application "System Events"
if exists file theFile then
return true
else
return false
end if
end tell
end fileExists
-- ------------------------------------------------------
(*
Philip Regan
https://stackoverflow.com/questions/3469389/applescript-testing-for-file-existence
*)
on fileExists(theFile) -- (String) as Boolean
tell application "System Events"
if exists file theFile then
return true
else
return false
end if
end tell
end fileExists