我在網上查了幾個小時尋找這個答案,所以我道歉,如果它在那裏。下面的腳本工作正常,除了它返回.DS_Store文件的事實,我怎麼能從這個查詢和所有其他隱藏文件中排除它,但因爲我在腳本中創建了唯一的文件夾.DS_StoreApplescript系統事件返回.DS_Store - 我該如何忽略
告訴應用程序「系統事件」 集listOfInputs到文件夾作爲列表 結束每個磁盤項目的POSIX路徑告訴
這裏是下面的完整劇本。在創建文件夾後,我一直在將文件放入文件夾中,但最終會在文件創建之前提示輸入文件。
上運行tell application "Finder"
if not (exists folder "IN") then
make new folder at desktop with properties {name:"IN"}
end if
if not (exists folder "OUT") then
make new folder at desktop with properties {name:"OUT"}
end if
end tell
set theINfolder to path to the desktop as string
set a to theINfolder & "IN:"
tell application "System Events"
set listOfInputs to POSIX path of every disk item of folder a as list
end tell
set inputs to listOfInputs
set theOutfolder to path to the desktop as string
set outputFolder to theOutfolder & "OUT:"
set params to {}
main(inputs, outputFolder, params)
運行結束
還要感謝。我沒有意識到列表文件夾已被棄用做shell腳本是我第一次嘗試沒有運氣的路線。我懷疑shell腳本很快就會被棄用。你知道我怎樣才能返回一個字符串(不是在一個列表中,但用空格分隔嗎?)的輸入列表,以便在我正在使用的單獨shell腳本中使用? – user1968247
查看編輯的版本... – adayzdone
謝謝tonne ....本網站是偉大的。快速高效。我感謝所有的幫助。 – user1968247