The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Hide View Bar in a Perspective? Thread Tools Search this Thread Display Modes
Is there a way to always hide the View Bar in a Perspective?

I have a Perspective called "Now" that opens in a new window, and has the Sidebar and Toolbar hidden, would like to also have the View Bar hidden automatically. Is that possible?

Thanks!
 
Normally the View Bar state is not saved as part of a perspective, so far as I can tell. However, if the perspective which has the non-default view bar state (in your case, no view bar) is set to open as a new window, as you have it, then taking a snapshot of the perspective with the view bar as you want it and the Restore Layout box checked seems to make the right thing happen. If you recycle that window to open a different perspective, however, the new perspective will get the view bar state left behind by the previous use.

I have one perspective that brings up a new window showing a focused list of template projects, and does not display the sidebar, the view bar, the tool bar, most of the columns. I close it when I am done with it, so the view bar issue goes away. If you want half of your perspectives to show the view bar and half not to, the path of least resistance is probably just to memorize cmd-shift-V (and send in a feature request with Help->Send Feedback).
 
This has been bugging me for a while. I usually want to enable/disable the tool bar and viewbar together.

With a bit of googling I cobbled the following applescript together that does the job:

Code:
tell application "OmniFocus"
	activate
	tell application "System Events" to keystroke "V" using command down
	tell application "System Events" to keystroke "t" using {command down, option down}
end tell
I'm running this from Alfred triggered with the command "oft", but I'll contact Omni and put in my request to have the view bar state stored by the perspective.
 
To piggyback off this message, is it possible to maintain the width of the view bar after switching to a new perspective?

Example, I expand the view bar to a larger-than-normal width in the Project perspective, them change to the Context perspective, then switch back to Project perspective, the width of the view bar is back to narrow again.

No way to make it wider by default?
 
Quote:
Originally Posted by psidnell View Post
I usually want to enable/disable the tool bar and viewbar together.

Code:
tell application "OmniFocus"
	activate
	tell application "System Events" to keystroke "V" using command down
	tell application "System Events" to keystroke "t" using {command down, option down}
end tell
FWIW, if you want scripts which specifically hide or show, rather than toggling (and which don't depend on particular keystroke assignments), you can also check which menu items are available, and click or desist accordingly.
Here's a GetMenuItem() function, with an example of using it to hide the Tool and View bars. (Editing the value of the pblnHide flag to false will turn it into a script for showing the two bars).

Code:
property pblnHide : true -- Edit to false for a script which SHOWS the Tool+View bars

on run
	tell application id "OFOC" to activate
	
	-- Check which menu items are available
	set mnuHideToolBar to GetMenuItem("OFOC", {"View", "Hide Toolbar"})
	set mnuShowToolBar to GetMenuItem("OFOC", {"View", "Show Toolbar"})
	
	set mnuHideViewBar to GetMenuItem("OFOC", {"View", "Hide View Bar"})
	set mnuShowViewBar to GetMenuItem("OFOC", {"View", "Show View Bar"})
	
	-- Click hide or show menus, as indicated by by the pblnHide flag
	tell application id "sevs"
		if pblnHide then
			if mnuHideToolBar is not missing value then click mnuHideToolBar
			if mnuHideViewBar is not missing value then click mnuHideViewBar
		else
			if mnuShowToolBar is not missing value then click mnuShowToolBar
			if mnuShowViewBar is not missing value then click mnuShowViewBar
		end if
	end tell
	
end run

-- Reusable menu functions
on GetMenuItem(strAppCode, lstMenu)
	set lngChain to length of lstMenu
	if lngChain < 2 then return missing value
	
	tell application id "sevs"
		set lstApps to application processes where its creator type = strAppCode
		if length of lstApps < 1 then return missing value
		tell first item of lstApps
			-- GET THE TOP LEVEL MENU
			set strMenu to item 1 of lstMenu
			set oMenu to menu strMenu of menu bar item strMenu of menu bar 1
			
			-- TRAVEL DOWN THROUGH ANY SUB-MENUS
			repeat with i from 2 to (lngChain - 1)
				set strMenu to item i of lstMenu
				set oMenu to menu strMenu of menu item strMenu of oMenu
			end repeat
			
			-- AND RETURN THE FINAL MENU ITEM (OR MISSING VALUE, IF UNAVAILABLE)
			try
				return menu item (item -1 of lstMenu) of oMenu
			on error
				return missing value
			end try
		end tell
	end tell
end GetMenuItem

on GUIEnabled()
	tell application id "sevs"
		if UI elements enabled then
			return true
		else
			activate
			display dialog "This script depends on enabling access for assistive devices in system preferences" buttons "OK" default button "OK" with title pTitle & "   " & pVer
			tell application id "sprf"
				activate
				set current pane to pane id "com.apple.preference.universalaccess"
			end tell
			return false
		end if
	end tell
end GUIEnabled
 
PS, as properties in .scpt files conserve their state between runs, you can, of course, get a toggle script by flipping the value of the flag at the end of the run:

Code:
property pblnHide : false

on run
	tell application id "OFOC" to activate
	
	-- Click hide or show menus, as indicated by by the pblnHide flag
	tell application id "sevs"
		if pblnHide then
			set mnuHideToolBar to my GetMenuItem("OFOC", {"View", "Hide Toolbar"})
			if mnuHideToolBar is not missing value then click mnuHideToolBar
			
			set mnuHideViewBar to my GetMenuItem("OFOC", {"View", "Hide View Bar"})
			if mnuHideViewBar is not missing value then click mnuHideViewBar
		else
			set mnuShowToolBar to my GetMenuItem("OFOC", {"View", "Show Toolbar"})
			if mnuShowToolBar is not missing value then click mnuShowToolBar
			
			set mnuShowViewBar to my GetMenuItem("OFOC", {"View", "Show View Bar"})
			if mnuShowViewBar is not missing value then click mnuShowViewBar
		end if
	end tell
	
	-- TOGGLE for next run
	set pblnHide to not pblnHide
end run
(Assumes the GetMenuItem() function in the previous post)
 
Cool, thanks Rob!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide a project (Someday) from the context view? David_Haddad OmniFocus 1 for Mac 5 2013-07-23 03:59 AM
Hide projects when in context perspective Senseful OmniFocus 1 for Mac 4 2011-02-21 10:13 PM
Is there any way to hide Due Soon in a Context view? Vramin Applying OmniFocus 5 2009-06-24 05:42 AM
hide inactive contexts in projects view? newtomac OmniFocus 1 for Mac 2 2008-10-01 11:28 PM
Wish: Hide/view Notes manfromuncle OmniFocus 1 for Mac 3 2008-04-11 04:10 PM


All times are GMT -8. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.