0

After I open a PDF file with Preview, I want to open the same file in another PDF viewer (Skim or Adobe Acrobat). How can Automator do this?

1

Here is an Automator Service/Quick Action that will open in Skim the front opened PDF document in Preview from the Preview > Services menu, or a keyboard shortcut if assigned in System Preferences > Keyboard > Shortcuts > Services.

This Automator Service was tested and works for me under macOS High Sierra assigning it a keyboard shortcut of ⌥⌘S, but should work as a Quick Action in macOS Mojave and later.

Example AppleScript code:

on run {input, parameters}
    tell application "Preview" to ¬
        set pdfDoc to (path of front document)
    tell application "Skim" to open pdfDoc
end run

Automator Service Workflow


Here is an Automator Service/Quick Action that will open the same PDF document(s) in both Preview and Skim from Finder.

In Finder, select one or more PDF documents, or a folder full of PDF documents and then right-click and select, e.g., Open PDF in Preview and Skim from the Services context menu.

This Automator Service was tested and works for me under macOS High Sierra, but should work as a Quick Action in macOS Mojave and later.

Example AppleScript code:

on run {input, parameters}
    tell application "Preview" to open input
    tell application "Skim" to open input
end run

Automator Service Workflow


Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.

4
  • Thanks. Is there any way to open Skim from Preview, not from Finder?
    – Chang
    Sep 26 '20 at 20:51
  • @Chang, I've updated my answer to accommodate your comment and is in line with your original question. I've left the other Automator Service/Quick Action as you may find it useful too. Sep 26 '20 at 21:00
  • I really appreciate it. It works great. One more question. If I want to enable this service in any application, instead of just Preview.app, how can I modify the AppleScript part?
    – Chang
    Sep 27 '20 at 1:10
  • 1
    @Chang, As not all applications use (or expose) the path property to show the path of the opened document and some are not directly scriptable, so it would take considerable coding to make it work for any application. For example, while you could open the PDF document in Adobe Reader you could not get the path property of that document from Adobe Reader to then open it in a different application. Not every widget can be a universal widget and sometimes you just have to build a widget to do a specific task. Sep 27 '20 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .