1

選択したフォルダー内の多数の画像を取得し、Graphic Converter を使用して画像をミラーリングする単純な Applescript があります。このスクリプトは、新しい AS ファイルに配置すると実行されます。ただし、もう一度実行しようとすると、「アプリケーション "GraphicConverter" のウィンドウ 1 を取得できません。無効なインデックスです。」というエラーが表示されます。

このスクリプトは常に OSX 10.6 で実行されました

OSX 10.7.4 と Graphic Converter 8.1 (最新バージョン) を実行しています。

ここにスクリプトがあります

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

これは私を夢中にさせています!

4

1 に答える 1

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
于 2012-07-09T22:44:46.603 に答える