Stacking Windows Macro

Get help using and writing Nisus Writer Pro macros.
capvideo
Posts: 20
Joined: 2008-03-16 16:41:16
Contact:

Re: Stacking Windows Macro

Post by capvideo » 2010-03-06 13:34:34

If I understand you correctly, you can do this with AppleScript.

Code: Select all

tell application "Nisus Writer Pro"
	set windowList to windows
	
	--the focus window is always window 1
	--hidden windows are in the list but have their visible set to false
	--miniaturized windows have their visible set to false
	--windows in other spaces *are* visible, but I don't know how to distinguish them
	
	set topWindow to the first item of windowList
	set windowBounds to bounds of topWindow
	
	set bottomWindows to the rest of windowList
	repeat with aBottomWindow in bottomWindows
		if aBottomWindow is visible then
			--display dialog name of aBottomWindow as string
			set bounds of aBottomWindow to windowBounds
		end if
	end repeat
end tell
I saved that script (using AppleScript Editor) in my ~/Library/Scripts/Applications/Nisus Writer Pro folder as "Stack lower windows beneath topmost window". The script is now available in the AppleScript menu. If you don't have an AppleScript menu, you can enable it in AppleScript Editor's General preferences.

This will allow you to use command tilde to rotate between documents in the current space. It does have the same problem that others did, of not knowing if windows are in the current space or not. It does, however, leave them in their current space; it just positions them in that space.

bjast
Posts: 39
Joined: 2010-01-06 10:58:07

Re: Stacking Windows Macro

Post by bjast » 2010-03-08 07:05:42

Thanks!

That worked exactly as advertised.

Much appreciated.

Post Reply