I have a nice macro that sets various view parameters of an open document. How do I apply that to all open documents?
Things like no pallets, window size and position, typewriter scrolling. Nothing in the doc content.
TiA, Ted
Loop through open documents
Loop through open documents
User since 1990
Most current NWp and MacOS
MacBookPro 16-inch 2023
Most current NWp and MacOS
MacBookPro 16-inch 2023
Re: Loop through open documents
G'day, Ted et al
Regular visitors will know that I have only rudimentary knowledge of the Nisus Macro Language, but I felt sure the answer would lie in at least one of the supplied Macros. And indeed there is a snippet of code for looping through all open documents in the Macro titled "Save All Documents" in the Document set of Macros that you may find helpful. It uses the Document Type Command "Document.openDocuments". It is also used in the Macro titled "Sort Open Document Windows" in the same location, so you know it must be good.
Cheers,
Adrian
Regular visitors will know that I have only rudimentary knowledge of the Nisus Macro Language, but I felt sure the answer would lie in at least one of the supplied Macros. And indeed there is a snippet of code for looping through all open documents in the Macro titled "Save All Documents" in the Document set of Macros that you may find helpful. It uses the Document Type Command "Document.openDocuments". It is also used in the Macro titled "Sort Open Document Windows" in the same location, so you know it must be good.
Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
macOS Ventura
Nisus Writer user since 1996
Re: Loop through open documents
Fantastic. Thanks
User since 1990
Most current NWp and MacOS
MacBookPro 16-inch 2023
Most current NWp and MacOS
MacBookPro 16-inch 2023
Re: Loop through open documents
As Adrian says Document.openDocuments should work. The following code will apply My Fantastic Macro to all open documents.
Code: Select all
foreach $doc in Document.openDocuments
Document.setActive $doc
My Fantastic Macro
end
philip