fullscreen without toolbar and rulers

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 229
Joined: 2007-04-12 14:59:36

fullscreen without toolbar and rulers

Post by js » 2012-08-27 15:27:42

I would prefer to work in full screen without toolbar and rulers and get them back in normal view.

I tried this:

Code: Select all

Set Toolbar Shown false
Set Rulers Shown false
Enter Full Screen 
to which I wanted to add conditions for showing / hiding in the right moment. But the 3 lines don't properly work as they stand. What did I do wrong?

User avatar
martin
Official Nisus Person
Posts: 4261
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: fullscreen without toolbar and rulers

Post by martin » 2012-08-27 16:10:40

js wrote:What did I do wrong?
On the surface, you didn't do anything wrong. However, the reason the Toolbar shows in Full Screen mode is because Apple always shows it whenever you switch to full screen no matter what (you can observer Mail.app has the same behavior). So, the first attempt at fixing this looks like this:

Code: Select all

Set Rulers Shown false
Enter Full Screen
Set Toolbar Shown false
Unfortunately that doesn't work either, because of Apple's full screen animation. Apparently the toolbar state is not changed immediately when the command is invoked, but at some transitionary point during the animation. So we need to add a delay, eg:

Code: Select all

Set Rulers Shown false
Enter Full Screen
Sleep 1
Set Toolbar Shown false
That works for me, though you might need to adjust the one second delay depending.

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: fullscreen without toolbar and rulers

Post by js » 2012-08-28 06:05:59

Thank you. This (mostly) works.

Speaking of the toolbar alone: How can one test if the Toolbar is visible or not, in order to have a macro work as a button that puts it either on or off?
I can't find this in the Macro Reference.

User avatar
martin
Official Nisus Person
Posts: 4261
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: fullscreen without toolbar and rulers

Post by martin » 2012-08-29 14:39:34

There's no special macro commands for checking the toolbar, but you can just have a peek to see if the menu is checkmarked or not:

Code: Select all

$isVisible = Menu State ":View:Toolbar:Show Toolbar"
If $isVisible
	Prompt "Toolbar is currently visible."
Else
	Prompt "No toolbar here!"
End

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: fullscreen without toolbar and rulers

Post by js » 2012-08-30 01:30:41

Thank you. This is very helpful.

Post Reply