Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to make Preview default to showing thumbnails for single-page item

When I open a multi-page item in Preview, the left-hand panel appears with thumbnails of all the pages. When I open a single-page item in Preview, the left-hand panel does NOT appear; I must choose View>Thumbnails.


How do I make Preview default to showing Thumbnails for all items?


Thanks!


MacBook Air (M1, 2020)

Preview Version 11.0 (1018.6.2)

macOS Big Sur 11.6.1 (20G224)


MacBook Air 13″, macOS 11.6

Posted on Nov 25, 2021 11:13 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 26, 2021 2:51 PM

Here is an Automator Quick Action (PDF All Thumbnails) that you right-click on a PDF (any number of pages), and then choose Quick Actions > PDF All Thumbnails from the secondary Finder menu. This will open any selected PDF in the Preview thumbnail view. Tested: macOS 11.6.1.


Steps:

  1. Launch /Applications/Automator; New document on Desktop; Quick Action, and click Choose.
  2. Drag and drop the Utilities Library > Run AppleScript into the large empty workflow window.
    1. Set Workflow receives current [ PDF files ] in [ Finder ]
    2. Change nothing else in this header area
    3. Select all of the content in the Run AppleScript action and remove it.
    4. Copy/paste the code from below into that Run Applescript window, and then click the hammer icon in the Run AppleScript toolbar.
  3. Save: PDF All Thumbnails (the name is your choice but recommend keep it short)
  4. Quit Automator


# PDF All Thumbnails.workflow

# Save as Automator Quick Action
# Right-click on PDF file, and from secondary menu, choose Quick Actions > PDF All Thumbnails.

use scripting additions

on run {input, parameters}
	
	tell application "Preview"
		activate
		open file input
		
		tell application "System Events"
			tell process "Preview"
				set frontmost to true
				click menu item "Thumbnails" of menu "View" of its menu bar
			end tell
		end tell
	end tell
    return
end run


10 replies
Sort By: 
Question marked as Top-ranking reply

Nov 26, 2021 2:51 PM in response to ladysun1969

Here is an Automator Quick Action (PDF All Thumbnails) that you right-click on a PDF (any number of pages), and then choose Quick Actions > PDF All Thumbnails from the secondary Finder menu. This will open any selected PDF in the Preview thumbnail view. Tested: macOS 11.6.1.


Steps:

  1. Launch /Applications/Automator; New document on Desktop; Quick Action, and click Choose.
  2. Drag and drop the Utilities Library > Run AppleScript into the large empty workflow window.
    1. Set Workflow receives current [ PDF files ] in [ Finder ]
    2. Change nothing else in this header area
    3. Select all of the content in the Run AppleScript action and remove it.
    4. Copy/paste the code from below into that Run Applescript window, and then click the hammer icon in the Run AppleScript toolbar.
  3. Save: PDF All Thumbnails (the name is your choice but recommend keep it short)
  4. Quit Automator


# PDF All Thumbnails.workflow

# Save as Automator Quick Action
# Right-click on PDF file, and from secondary menu, choose Quick Actions > PDF All Thumbnails.

use scripting additions

on run {input, parameters}
	
	tell application "Preview"
		activate
		open file input
		
		tell application "System Events"
			tell process "Preview"
				set frontmost to true
				click menu item "Thumbnails" of menu "View" of its menu bar
			end tell
		end tell
	end tell
    return
end run


Reply

Dec 1, 2021 5:41 AM in response to ladysun1969

I have decided to recode the Automator Quick Action to avoid using the Run Applescript action. What I have written will still pop a dialog stating that Finder wants to control the Preview application. Open the panel below before you click the OK button on that dialog to the Automation section. Then click the OK button and you will see Preview added below System Events.


Note, I already had System Events in here, and you may be prompted with two dialogs when first running this Quick Action: 1) Finder wants to control System Events, and 2) Finder wants to control Preview. Each click of the OK button will add its permission as shown below.



Now, when I select a PDF in Finder and then choose Quick Actions > Use PDF Thumbnails, it works for any selected PDF, just as planned. I changed the name of the Quick Action when I saved it.


This time, I am using Automator's Library > Utilities > Run Shell Script action, and NOT Run AppleScript. Here is what the finished Quick Action looks like:



When you drag the Run Shell Script to the workflow window, and set the shell to /bin/zsh and Pass input: as arguments, you will see new content appear in the window. Select that content and backspace to remove it. Replace that run shell script content with the following code:


: <<"COMMENT"

Select PDF document in Finder and then right-click and choose Quick Actions > Use PDF Thumbnails.
COMMENT

function show_thumbnails () {
	osascript <<-AS
		use scripting additions

		tell application "Preview"
		activate
		open file POSIX file "${1}" as alias

		tell application "System Events"
			tell process "Preview"
				set frontmost to true
				click menu item "Thumbnails" of menu "View" of its menu bar
			end tell
		end tell
		end tell
		return
AS
}


show_thumbnails "${@}"
exit 0


Then save, and name your new Quick Action.



Reply

Nov 30, 2021 3:26 PM in response to VikingOSX

@VikingOSX -- thanks! I did what you suggested but when I try to activate it from the secondary Finder menu, I get an error:


The action "Run AppleScript" encountered an error: "System Events got an error: Automator Workflow Runner (WorkflowServiceRunner, PDF All thumbnails) is not allowed assistive access."


I googled that error message and found this from 2019:

https://stackoverflow.com/questions/57349831/com-automator-runner-xpc-is-not-allowed-assistive-access-cannot-click-when-run


in which the OP says that they made it work by making it into an application, gave it permissions, and then called it from a quick action. Do you think that process will fix this?


Thanks again!

Reply

Nov 26, 2021 12:14 PM in response to ladysun1969

On further investigation, one must enable Thumbnails on any PDF, and a subsequently opened single-page PDF will also show a thumbnail. Not having a thumbnail view set on the last PDF viewed, before opening a single-page PDF will suppress the thumbnail view on that PDF.

Reply

Nov 26, 2021 1:13 PM in response to ladysun1969

Agreed. There is no user fix for automatic thumbnails on every opened single-page PDF.


I imagine one could write an Automator Quick Action that when you click on a PDF document, it would get the page count, and trigger Preview to enable thumbnails for single-page PDF. I haven't tested this, but seems possible.

Reply

Nov 30, 2021 4:10 PM in response to ladysun1969

Did you click the OK button and try running it again?


When prompted below, enter your admin password to gain access to the System Preferences


Otherwise, System Preferences > Security & Privacy panel. Enter your admin password to unlock it, and then select Privacy > Accessibility and add [+] Automator (in your /Applications folder) to Accessibility. Quick the Preferences panel, and try running the script again.

Reply

Nov 30, 2021 4:34 PM in response to VikingOSX

Did you click the OK button and try running it again?


When I click the OK button on that error popup, the popup goes away. If I then run the Quick Action again, I get the same error popup. System Preferences doesn't open or prompt for anything.



Otherwise, System Preferences > Security & Privacy panel. Enter your admin password to unlock it, and then select Privacy > Accessibility and add [+] Automator (in your /Applications folder) to Accessibility. Quick the Preferences panel, and try running the script again.

I added Automator to Accessibility & ran the script again. Same error.


Here's a screen recording: https://youtu.be/NJQJgi9jTzk


Thanks again!

Reply

How to make Preview default to showing thumbnails for single-page item

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.