2017-04-13 6 views
0

내부 파일의 이름을 바꿉니다. 는 현재 파인더 창 (선택)에서 폴더를 복사하고 이름을 바꿀 수 있도록 AppleScript를 - 중복 폴더 이름 바꾸기 & I는 현재 파인더 창 템플릿 폴더에 다음 새 폴더 대화 입력에 따라 그 안의 파일의 몇 가지 이름을 변경 복사하는 스크립트를 만들려고 해요

지금까지 내가있어. 하지만 파일 이름을 바꿀 수는 없습니다. 그들은 내 회사 이름 등이 포함 나는이 POSIX 파일 경로를 잘라 한

property A : POSIX file "/BLOCKED OUT FOR PRIVACY/" as alias 
property B : POSIX file "/BLOCKED OUT FOR PRIVACY/" as alias 
property C : POSIX file "/BLOCKED OUT FOR PRIVACY/" as alias 
property D : POSIX file "/BLOCKED OUT FOR PRIVACY/" as alias 

tell application "Finder" 
set x to target of window 1 as alias 
end tell 

set JobName to text returned of (display dialog "Enter Folder Name:" default answer "Template Folder") 

set CATno to text returned of (display dialog "Enter CAT number:" default answer "CMXX0000") 

set optionList to {"OPTION 1", "OPTION 2", "OPTION 3", "OPTION 4"} 

set chosenFolder to choose from list optionList with prompt "Choose a Folder" 

set chosenFolder to chosenFolder's item 1 

if chosenFolder is "OPTION 1" then 

tell application "Finder" 
    set FolderCopy to duplicate B to x 
    set the name of FolderCopy to JobName 
    set Insert to (POSIX path of (path to home folder)) & "DVD Insert Artwork/Indesign Project File/_Insert.indd" as POSIX file 
    set the name of Insert to JobName & CATno 
end tell 
end if 

-

여기에 코드입니다. 나는 또한 본질적으로 첫 번째와 중복되는 것처럼 if의 다른 부분을 생략했습니다.

set Insert to (POSIX path of (path to home folder)) & "DVD Insert Artwork/Indesign Project File/_Insert.indd" as POSIX file 
set the name of Insert to JobName & CATno 

이것은 내게 문제가되는 부분입니다. 그것은 어떤 도움을 주시면 더 좋구요 + "_Insert.indd"

CATno 대화 상자에 입력 년대 무엇을 새로 복제 된 폴더에있는 파일의 이름을 변경해야합니다!

고마워요 :)

답변

1

잘 모르겠지만이 뜻입니까?

tell application "Finder" 
    set FolderCopy to duplicate B to x 
    set insertFile to file "_Insert.indd" of FolderCopy 
    set the name of FolderCopy to JobName 
    set name of insertFile to (JobName & CATno & "_Insert.indd") 
end tell 

중복 된 폴더에서 indesign 파일에 대한 참조를 가져옵니다. 제안에 대한

+0

감사합니다. 그러나이 오류를 반환 - "파인더는 오류가 발생했습니다 : 파일을 가져올 수 없습니다" "폴더의"_Insert.indd 템플릿 폴더 - "폴더의"숨겨진 다운로드 "폴더의"새로운 "폴더의"Air.Giraffe "폴더의" 사용자 "시동 디스크 (-1728)"이름을 바꾸려는 파일은 여기에 문제가 될 수있는 복제 된 폴더의 하위 폴더 내에 있습니다. – Airgiraffe

+0

당신은 파일의 전체 경로를 지정해야합니다 파일에'설정 insertFile 예를 들어 (콜론으로 구분) (텍스트로 (FolderCopy를) "subfolder1 : subfolder2 : _Insert.indd")'. 질문에 폴더 계층 구조에 대한 정보가 포함되어 있지 않으므로 더 정확하게 설명 할 수 없습니다. – vadian

+0

이것은 효과가 있습니다! 고맙습니다. 나는 FolderCopy의 이름을 JobName으로 설정해야했다. – Airgiraffe