OK, 알겠습니다. 당신은이 같은 자동화 워크 플로우 내에서 아래의 애플 스크립트 사용할 수 있습니다 : 확장자가 ext_list
에있는 경우 Finder에서 모든 선택 파일에 대해
를, 그것은 휴지통으로 이동하고, 그렇게 될 것입니다 확장자가 also_these_extensions
인 같은 폴더에 같은 이름의 다른 모든 파일이 있습니다.
보조 LaTeX 파일이있는 폴더를 청소하는 경우에도 "tex"
을 ext_list
에 넣고 다른 모든 확장자 (예 : "aux", "dvi", "log"
)를 also_these_extensions
에 넣으십시오.
선택한 파일이 동일한 폴더에있을 필요는 없습니다. Spotlight 검색 결과 창에서 여러 항목을 선택할 수도 있습니다.
on run {input, parameters}
-- for every item having one of these extensions:
set ext_list to {"dng"}
-- also process items with same name but these extensions:
set other_ext_list to {"xmp"}
tell application "Finder"
set the_delete_list to {}
set delete_list to a reference to the_delete_list
-- populate list of items to delete
repeat with the_item in input
set the_item to (the_item as alias)
if name extension of the_item is in ext_list then
copy the_item to the end of delete_list
set parent_folder to (container of the_item) as alias as text
set item_name to text 1 thru ((length of (the_item's name as text)) - (length of (the_item's name extension as text))) of (the_item's name as text)
repeat with ext in other_ext_list
try
copy ((parent_folder & item_name & ext) as alias) to the end of delete_list
end try
end repeat
end if
end repeat
-- delete the items, show info dialog
move the_delete_list to the trash
display dialog "Moved " & (length of the_delete_list) & " files to the Trash." buttons {"OK"}
end tell
end run
AppleScript를 작성하는 것은 쉽지만 (필자는 Automator 워크 플로우에 임베드 할 수는 있지만 할 필요는 없지만) 요점을 실제로 볼 수는 없습니다. 왜 Finder보기를 파일 이름별로 정렬하지 않고 제거하려는 모든 파일을 선택하고 cmd + baskspace를 누르십시오. – fanaugen
좋은 질문 - EyeFi 카드를 통해 업로드 된 이미지로 가득 찬 디렉토리를 스크롤하고 저장하고 싶지 않은 파일을 끌어 와서 삭제할 일치하는 XMP 파일을 찾는 것에 대해 걱정할 필요가 없습니다. XMP 파일을 스크롤하지 않아도 됨). –