通过AppleScript在单个预览窗口中打开多个图像

时间:2016-05-06 14:59:56

标签: macos 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

有人能指出我正确的方向吗?

1 个答案:

答案 0 :(得分:0)

只需将图片放入列表并告诉factory('ModalService', function($uibModal){ function openModal(options){ var modalInstance= $uibModal.open(options); return modalInstance.result; } return { openModal: openModal } }) //in controller: vm.showObjectInfo = function () { ModalService.openModal({ animation: true, templateUrl: 'frmObjectInfo.html', backdrop: 'static', keyboard: false }).then(function(){ // Refresh something in this document }) }; 使用Finder打开文件

Preview