Я пытаюсь очистить файл сценария оболочки, если он существует, но продолжаю сталкиваться с ошибками.
tell application "System Events"
set fileList to POSIX path of disk items of mdFolder
end tell
-->check to see if there is a shell script in the destination folder
repeat with i from 1 to count of every item in fileList
set thisFile to item i of fileList
set oasd to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
set fileName to last text item of thisFile
if fileName is equal to "ditaShell.sh" then
tell application "System Events" to delete thisFile
end if
end repeat
tell application "Finder"
-->create new file for shell script
make new file at mdFolder with properties {name:"ditaShell.sh"}
display dialog "Created new file"
end tell
Я получаю это сообщение об ошибке:
System Events got an error: Can’t make "/Users/xxxxxxxxx/Desktop/DITAConversions/Input/ditaShell.sh" into type disk item.