Stacking Windows Macro
Stacking Windows Macro
New to Nisus.
How would I go about writing a macro to automatically stack all of the open windows exactly on top of each other?
Thanks
How would I go about writing a macro to automatically stack all of the open windows exactly on top of each other?
Thanks
Re: Stacking Windows Macro
If I don’t misunderstand you, you don’t need a macro for that. With the option key pushed down, “Bring All to Front” command under Windows menu will change to “Arrange in Front” which does the job. This command is available in many OS X applications.
Re: Stacking Windows Macro
That's a nice feature, and close to what I had in mind. But what I actually would like is for all of the windows to stack 'exactly' on top of one another. Guess I'm just a neat freak, but it helps me concentrated on the current document.
I have set my Desktop background to the same color of the background of my NWP docs, so it appears as though the front doc is the only thing on the entire screen.
Thanks
I have set my Desktop background to the same color of the background of my NWP docs, so it appears as though the front doc is the only thing on the entire screen.
Thanks
Re: Stacking Windows Macro
That is not feasible. There is no macro command for getting/setting the coordinates of a document window.bjast wrote:But what I actually would like is for all of the windows to stack 'exactly' on top of one another.
Re: Stacking Windows Macro
That's unfortunate. I suppose that means that the Arrange in Front command - implemented by pressing Option while selecting Window > Bring All to the Front - is system-wide, and not unique to NWP.
Is there a way to hide a window that, perhaps, could be exploited through a macro to hide more than one window in succession?
Thanks
Is there a way to hide a window that, perhaps, could be exploited through a macro to hide more than one window in succession?
Thanks
Re: Stacking Windows Macro
A macro can hide a window but only while a macro is running. So it is not usable for this purpose. But perhaps minimizing all windows except the frontmost would achieve something close to what you need?The macro above de-minimizes documents already minimized before minimizing them. That is inelegant but there is no way for a macro to know if a document is minimized or not.
And the following shows (de-minimizes) all open documents.
Code: Select all
$frontmost = Document.active
if $frontmost == undefined
exit
end
$docs = Document.openDocuments
foreach $doc in $docs
$doc.show
if $doc != $frontmost
Send Selector 'miniaturize:'
end
end
And the following shows (de-minimizes) all open documents.
Code: Select all
$docs = Document.openDocuments
if $docs != undefined
foreach $doc in $docs
$doc.show
end
end
Re: Stacking Windows Macro
Thanks Kino. I'll check this out.
It's intriguing that, for as extensive as it is for writing macros, NWP does have a way to handle the coordinates of open windows.
Curious ...
It's intriguing that, for as extensive as it is for writing macros, NWP does have a way to handle the coordinates of open windows.
Curious ...
Re: Stacking Windows Macro
If that's all you want then why not simply use View>Full Screen mode? Then the front window is the only thing on the entire screen.bjast wrote:That's a nice feature, and close to what I had in mind. But what I actually would like is for all of the windows to stack 'exactly' on top of one another. Guess I'm just a neat freak, but it helps me concentrated on the current document.
I have set my Desktop background to the same color of the background of my NWP docs, so it appears as though the front doc is the only thing on the entire screen.
Thanks
Re: Stacking Windows Macro
Good observation. I would do as you suggested if there were not the limitations (bugs?) that currently exist in the Full Screen Mode: See this thread:dshan wrote:If that's all you want then why not simply use View>Full Screen mode? Then the front window is the only thing on the entire screen.
http://nisus.com/forum/viewtopic.php?f=18&t=3645
Re: Stacking Windows Macro
Even if the Full Screen view did not have those bugs or limitations, I think NWP macro should have commands for inspecting/modifying window coordinates (available in NW Classic) as well as a command reporting the text range of the currently visible area of a document (necessary for a Top of Page macro requested by you in another thread). So I just sent them a feedback requesting those commands. They will be a significant enhancement for the NW Pro macro language. Thank you very much!bjast wrote:It's intriguing that, for as extensive as it is for writing macros, NWP does <not> have a way to handle the coordinates of open windows.
Re: Stacking Windows Macro
Thanks Kino for adding < not > to my previous message. Am I hearing you correctly, that NW offers these window coordinates, and NWP does not? That is curious indeed, as you would think you were getting a more advanced product with the "Pro" version.
Re: Stacking Windows Macro
Yes, the following commands (or rather keywords) are available in NW Classic macro.
RectRight Nisus[FrontWindow][WindowRect][...]
RectLeft Nisus[FrontWindow][WindowRect][...]
RectTop Nisus[FrontWindow][WindowRect][...]
RectBottom Nisus[FrontWindow][WindowRect][...]
I did not use them so often but they were indispensable for a macro which force-redraws document windows. I wrote it in order to solve a Classic environment issue.
Although NW Pro macro is much more advanced, efficient, and extensive in many points, not all NW Classic macro features are available yet. The most important missing one would be the ability to record a macro. Of course, we should understand that NW Pro/Express is not an updated version of NW Classic but a new application written from scratch and that something easily feasible in legacy Mac OS is not always so in OS X, though.
RectRight Nisus[FrontWindow][WindowRect][...]
RectLeft Nisus[FrontWindow][WindowRect][...]
RectTop Nisus[FrontWindow][WindowRect][...]
RectBottom Nisus[FrontWindow][WindowRect][...]
I did not use them so often but they were indispensable for a macro which force-redraws document windows. I wrote it in order to solve a Classic environment issue.
Although NW Pro macro is much more advanced, efficient, and extensive in many points, not all NW Classic macro features are available yet. The most important missing one would be the ability to record a macro. Of course, we should understand that NW Pro/Express is not an updated version of NW Classic but a new application written from scratch and that something easily feasible in legacy Mac OS is not always so in OS X, though.
Re: Stacking Windows Macro
Thanks for the insight. Being new to NWP and Nisus in general, I didn't realize that NWP was a complete rewrite. This helps me to make more sense out of its limitations.
Re: Stacking Windows Macro
I sent a feedback requesting such macro commands and Martin kindly reminded me of isVisible command. So here is a revised version.kino wrote:The macro above de-minimizes documents already minimized before minimizing them. That is inelegant but there is no way for a macro to know if a document is minimized or not.
Code: Select all
### Minimize All Windows except the Frontmost ###
$frontmost = Document.active
if $frontmost == undefined
exit # because no window is open
end
$docs = Document.openDocuments
$docs.removeValueAtIndex 0 # exclude the frontmost document
foreach $doc in $docs
if $doc.isVisible
Document.setActive $doc
Send Selector 'miniaturize:'
end
end
Re: Stacking Windows Macro
Thanks Kino. This is an improvement and does a good job of minimizing all but the frontmost window.
The challenge I'm finding is that I work with multiple windows at a time, and need to Command Tilde rotate between them. This, obviously, doesn't work when the windows are minimized.
Hopefully, they will add the option you requested to a future version of NWP.
Thanks
The challenge I'm finding is that I work with multiple windows at a time, and need to Command Tilde rotate between them. This, obviously, doesn't work when the windows are minimized.
Hopefully, they will add the option you requested to a future version of NWP.
Thanks