2012-07-09 6 views
1

나는 선택한 폴더에서 많은 이미지를 가져와 Graphic Converter를 사용하여 이미지를 미러링하는 간단한 AppleScript가 있습니다. 이 스크립트는 새 AS 파일에 배치하면 실행됩니다. 그러나 두 번째 실행하려고하면 응용 프로그램 "GraphicConverter"창 1을 가져올 수 없습니다. "잘못된 인덱스를 가져옵니다."단순한 스크립트가 더 이상 Lion에서 작동하지 않습니다.

이 스크립트는 항상 내가 OSX 10.7.4 및 그래픽 변환기 8.1 (최신 버전)을 실행하고있어 OSX 10.6

에 달렸다.

다음은 스크립트

tell application "Finder" 
    activate 
    set loopFinish1 to 0 
    set pathName to (choose folder with prompt "Choose Folder Containing Images") 
    set fileList1 to every file of folder pathName 
    set loopFinish1 to count of items of fileList1 
end tell 

tell application "GraphicConverter" 
    activate 
    repeat with i from 1 to loopFinish1 
     set currentFile to item i of fileList1 
     open currentFile as alias 
     mirror window 1 in horizontal 
     close window 1 saving yes 
    end repeat 
end tell 

이 나를 미치게입니다!

답변

2

GraphicConverter에는 다른 창 (보이거나 보이지 않음)이 있으므로 올바른 창을 표시하려면 문서를 사용하는 것이 좋습니다. 또한 이미지가 열리지 않으므로 창이 나타나지 않으므로 try 블록을 사용하십시오.

activate 
set pathName to (choose folder with prompt "Choose Folder Containing Images") 
tell application "Finder" to set fileList1 to (document files of folder pathName) as alias list 

tell application "GraphicConverter" 
    activate 
    repeat with tFile in fileList1 
     set currentDoc to open tFile 
     set CurrWindow to (first window whose its document is currentDoc) 
     mirror CurrWindow in horizontal 
     close currentDoc saving yes 
    end repeat 
end tell 
관련 문제