2016-05-06 10 views
0

Ich versuche, mehrere Bilder im selben Vorschaufenster zu öffnen. Wenn Sie z. B. mehrere Bilder in die Seitenleiste der Vorschau ziehen, werden sie sauber in einem Fenster angezeigt.Mehrere Bilder in einem einzigen Vorschaufenster über AppleScript öffnen

Dieser Code wird alle Bilder öffnen, aber in separaten Fenstern:

-- 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 

jemand mich in die richtige Richtung zeigen kann?

Antwort

0

Einfach die Bilder in eine Liste und die Finder sagen, die Dateien zu öffnen 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

wie ein Charme mit. Vielen Dank! – cagrimmett

Verwandte Themen