이미지에 여러 자리 표시자가 포함 된 템플릿을 만들었습니다.
다음을 수행하고 싶습니다.
- 템플릿 복제본 만들기
- 템플릿의 이미지 교체 (CSV 또는 텍스트 파일)
- 프레젠테이션을 영화로 내보내기
- 다음 복제를 위해 반복
Applescript로 이것을 수행하는 방법이 있습니까? Automator는이를 달성 할 수있는 Keynote 작업이없는 것 같습니다.
답변
그렇습니다. 스크립트의 대부분은 다음과 같습니다.
--ImageTemp would from your csv file in a repeat loop, but here's an image from the desktop for demonstration:
set ImageTemp to ((path to desktop as text) & "Screen Shot 2018-04-29 at 2.55.28 PM.png") as alias
tell application "Keynote"
activate
--Replace an image
set SlidesCol to slides of document 1
set SlidesColcount to (count of SlidesCol)
(*Assuming here that you are going to replace an image in every slide of the presentation with the same image, ImageTemp, which is unlikely, but to not complicate matters:*)
repeat with i from 1 to count of SlidesCol
set slideItem to item i of SlidesCol
set ImagesItem to image 1 of slideItem
set file name of ImagesItem to ImageTemp
end repeat
--Finally, export File as a movie
set ReceiveV to (path to desktop as text) & "ReceiverContainer.m4v" as string
export document 1 as QuickTime movie to file ReceiveV
end tell
물론 프레젠테이션에 맞게 편집해야합니다 (예 : 스크립트가 각 슬라이드의 첫 번째 이미지를 대체 함). 프레젠테이션이 열려 있다고 가정하지만 복제하고 반복 할 때 열고 닫아야합니다. 그러나 나머지 스크립트는 훨씬 간단합니다. 파인더로 파일을 복제하고 필요한 것을 반복 루프에 넣습니다.