Automator script to set/clear Show icon preview

I needed to change Finder's Show icon preview setting for a large number of folders containing image files. Fortunately, the Automator application is available to automate such repetitive tasks.


Below is a set of Automator actions to toggle the Show icon preview setting. The workflow can be used to create an Automator application, or a quick action.


- Pie Lover


Complete Workflow


Action Details


Select the parent image folder

on run {input, parameters}
	
	if input is {} then -- nothing dropped
		return (choose folder with prompt "Select the parent image folder" default location alias (path to pictures folder))
	else
		
		if (count of items in input) = 1 then
			tell application "System Events"
				set theFolder to path of (item 1 of input)
			end tell
		else
			error "Can only process a single folder"
		end if
		
		return alias (theFolder)
		
	end if
	
end run


Toggle the icon preview setting for the parent folder (or a single folder)


on run {input, parameters}
	
	repeat with thisFolder in input
		
		tell application "Finder"
			
			open thisFolder
			
			if (current view of front Finder window) is icon view then
				set (shows icon preview of icon view options of front Finder window) to (not shows icon preview of icon view options of front Finder window)
			else if (current view of front Finder window) is list view or (current view of front Finder window) is flow view then
				set (shows icon preview of list view options of front Finder window) to (not shows icon preview of list view options of front Finder window)
			else if (current view of front Finder window) is column view then
				set (shows icon preview of column view options of front Finder window) to (not shows icon preview of column view options of front Finder window)
				if (shows icon preview of column view options of front Finder window) then set (shows icon of column view options of front Finder window) to true
			end if
			
			close front Finder window
			
		end tell
		
	end repeat
	
	return input
	
end run


Get the folder contents including subfolders


Select the subfolders only


Toggle the icon preview setting for each subfolder


on run {input, parameters}
	
	repeat with thisFolder in input
		
		tell application "Finder"
			
			open thisFolder
			
			if (current view of front Finder window) is icon view then
				set (shows icon preview of icon view options of front Finder window) to (not shows icon preview of icon view options of front Finder window)
			else if (current view of front Finder window) is list view or (current view of front Finder window) is flow view then
				set (shows icon preview of list view options of front Finder window) to (not shows icon preview of list view options of front Finder window)
			else if (current view of front Finder window) is column view then
				set (shows icon preview of column view options of front Finder window) to (not shows icon preview of column view options of front Finder window)
				if (shows icon preview of column view options of front Finder window) then set (shows icon of column view options of front Finder window) to true
			end if
			
			close front Finder window
			
		end tell
		
	end repeat
	
	return true
	
end run


Mac mini (M2, 2023)

Posted on Jan 18, 2025 6:36 AM

Reply
2 replies
Sort By: 

Jan 18, 2025 11:45 AM in response to leroydouglas

Thanks, I believe the I was aware of this feature. Unfortunately, I still need about 4,000 more points to reach Level 5.


In any case, I hope some folks will find this post useful. Actually, the workflow forms part of a workaround to a problem related to image thumbnail generation in Sequoia (in certain cases, the ImageThumbnailExtension process was running indefinitely at 100% CPU on each of the 4 Performance cores on a Mac mini M2).


- Pie Lover

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator script to set/clear Show icon preview

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