2016-05-06 4 views
0

Я пытаюсь открыть несколько изображений внутри одного окна предварительного просмотра. Например, если вы перетащите несколько изображений в боковую панель Preview, они будут аккуратно держать их внутри одного окна.Открыть несколько изображений в одном окне предварительного просмотра через AppleScript

Этот код открывает все изображения, но в отдельных окнах:

-- Getting path to this file 
tell application "Finder" to get folder of (path to me) as Unicode text 
set currentLocation to result 

-- Open image results in Preview 
tell application "Preview" 
    open currentLocation & "img:weekdays_bar.png" 
    open currentLocation & "img:weekdays_pie.png" 
    open currentLocation & "img:months_bar.png" 
    open currentLocation & "img:seasons_bar.png" 
    open currentLocation & "img:seasons_pie.png" 
    open currentLocation & "img:am_pm_pie.png" 
end tell 

Может кто-нибудь мне точку в правильном направлении?

ответ

0

Просто поместите фотографии в список и скажите Finder, чтобы открыть файлы с помощью Preview

tell application "Finder" to set currentLocation to container of (path to me) as text 
set thePictures to {currentLocation & "img:weekdays_bar.png", currentLocation & "img:weekdays_pie.png", ¬ 
    currentLocation & "img:months_bar.png", currentLocation & "img:seasons_bar.png", ¬ 
    currentLocation & "img:seasons_pie.png", currentLocation & "img:am_pm_pie.png"} 
tell application "Finder" to open thePictures using application file id "com.apple.preview" 
+0

Работал как шарм. Спасибо! – cagrimmett

Смежные вопросы