하루 종일 다음을 시도했습니다. 99 개의 하위 폴더가 있습니다. 각 하위 폴더 안에 pdf 파일이 있으며 모두 동일한 이름을 사용하도록 이름을 바꿔야합니다. 지금 그들은 연속적인 숫자로 지명된다. 스크립팅을하는 초보자로서 나는 자동화 도구로 모든 것을 해왔다. 하지만 나는 문제를 포기하는 것을 좋아하지 않습니다. 인터넷 검색은 좋은 해결책을 제시하지 못했습니다. 나는 예제 스크립트를 이해하고 수정하려고 시도했지만 성공하지 못했습니다. 나는 또한 시도사과 스크립트가있는 하위 폴더의 항목 이름을 바꿉니다.
tell application "Finder"
set selected to selection
open selected
get files of folders of selected
set name of files of folders to "anschreiben"
end tell
: 짧은 시도했다
tell application "Finder"
set selected to selection
open selected
set mlist to every folder of selected
set current_folder to first item of selected
set xxx to first item of current_folder
set name of xxx to "yyy"
repeat with this_folder in mlist
open current_folder
set item 1 to item of current_folder
end repeat
end tell
을하지만,이 이름을 변경하기 때문에이 (파일 이름이 이미 주어진 것을 YYY에 첫 번째 폴더의 이름을 변경하고 생산 및 오류 하위 폴더가 아니라 내부의 파일)
이렇게 ... 하위 폴더에있는 모든 파일의 이름을 바꾸려면 어떻게해야합니까 ??
감사합니다. 아마 쉽게 알 수 있습니다. 이 이루어집니다
set newName to "New.pdf"
tell application "Finder"
set myFiles to every file of (entire contents of (first item of (selection as alias list)))
repeat with aFile in myFiles
set aFile's name to newName
end repeat
end tell
빠른 응답을 주셔서 감사합니다. 그러나이 코드는 두 번째 하위 폴더를 변경하려고 할 때 첫 번째 하위 폴더의 이름이 바뀌고 'name already exists'라는 오류 메시지가 다시 표시 될뿐입니다. 그러나 나는 전체 내용 힌트를 조사하고있다! 모든 작은 도움이됩니다! –
테스트하기 전에 게시, 죄송합니다. 수정 된 버전 – adayzdone
ooooohhh yeeaahhh를 사용해보세요! 정말 고맙습니다!!! 그게 속임수 야! –