Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Toggle Mail.app's preview pane from the menu or keyboard Apps
I've always been slightly annoyed that Mail doesn't have a keyboard shortcut (or menu item) to toggle showing/hiding the message preview pane, so I wrote a little script to do this. Place the script in your account's Library -> Scripts -> Mail Scripts directory and it will show up in Mail's script menu. To assign it the keyboard shortcut Command-Control-P, I named the script file "PreviewPane Toggle___ctl-cmd-p.scpt". (One can also use the method described in this 10.3 hint.)

tell application "Mail"
  tell message viewer 0
    if preview pane is visible then
      set preview pane is visible to false
    else
      set preview pane is visible to true
    end if
  end tell
end tell
[robg adds: To me, one of the neater aspects of this hint is the tidbit on how to add the keyboard shortcut to a Mail script -- I had no idea it was possible by simply naming the file in a certain manner! I've now added keyboard shortcuts via file naming to the two other Mail scripts I use all the time ... very handy! I also tried with a Finder script, but it didn't seem to work there.]
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[12,803 views]  

Toggle Mail.app's preview pane from the menu or keyboard | 6 comments | Create New Account
Click here to return to the 'Toggle Mail.app's preview pane from the menu or keyboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle Mail.app's preview pane from the menu or keyboard
Authored by: sydlow on May 01, '05 02:00:03AM

Is this approach for keyboard shortcuts still valid in Tiger 10.4? I can't seem to get it to work.



[ Reply to This | # ]
Toggle Mail.app's preview pane from the menu or keyboard
Authored by: dcjames on Jul 20, '05 08:15:22PM
In my understanding, Tiger's Mail.app does not allow Applescripts to be fired by creating files in the Scripts folder. (Although Panther's Mail.app did!) Go here for more discussion about this (Defrag David's Brain)

[ Reply to This | # ]
Script improvement and Tiger tip
Authored by: ryancu on Oct 09, '05 04:32:12AM
This script does not work properly if you have more than one Mail viewer window open. It effects the oldest viewer instead of the frontmost. Here is an improved version which always works on the frontmost window:

tell application "Mail"
	repeat with thisViewer in (every message viewer)
		if (window of thisViewer) is window 0 then exit repeat
	end repeat
	tell thisViewer
		if preview pane is visible then
			set preview pane is visible to false
		else
			set preview pane is visible to true
		end if
	end tell
end tell
Also, people looking for a way to run scripts using the keyboard in Tiger can configure the free QuickSilver to do so. Remember to only make the keyboard trigger work when Mail is active.

[ Reply to This | # ]
Script improvement and Tiger tip
Authored by: slswift on Jul 15, '09 08:39:03AM

Thanks! Here it is nearly 4 years later, I'm using Leapord, and this trick works perfectly!

Really, thanks again. I have always wanted a way to toggle the preview pane. It just took me a long time to google for it. This was one of the first hits, and a great bit of AppleScript.

Spencer



[ Reply to This | # ]
Toggle Mail.app's preview pane from the menu or keyboard
Authored by: yrstruely on Dec 07, '10 01:40:50AM

I tried this on snow leopard 10.6.5 and Mail version 4.4 and the script worked, although saving the script with the suggested name did not allow me to use the keyboard shortcut.

Anyway, thanks for this.



[ Reply to This | # ]
Toggle Mail.app's preview pane from the menu or keyboard
Authored by: morespace54 on Dec 07, '10 07:48:17AM

Unfortunately, the naming scheme doesn't seems to work anymore (at least, on 10.6). So, if anyone knows a similar trick to assign a script to a keyboard shortcut (without resorting to the usual pref pane), that would be more than welcome!

Edited on Dec 07, '10 07:49:16AM by morespace54



[ Reply to This | # ]