#!/usr/bin/env python3 # ++ 1.000 2026-11-09 11:36:25 38f4e38c57c88aa57855f3c1ad018265de96ae3b VERSION=1.000 """ Scribus script to show problem with textOverflows method. Requires two text frames called "Text1" and "Text2", with Text1 linked to Text2. The chained frames should have enough text in them to provoke a "text overflowed" icon in Text2. Execute scribusfrom the command line to see the messages issued by print(). """ import sys try: import scribus except ImportError as err: print ("This Python script is written for the Scribus scripting interface.") print ("It can only be run from within Scribus.") sys.exit(1) def main_wrapper(argv): main(argv) def main(argv): print("\nStarting:") objectsSelected = scribus.selectionCount() selectedFrames = [] for i in range(0,objectsSelected): selectedFrames.append (scribus.getSelectedObject(i)) print(f"{objectsSelected} object(s) selected: {selectedFrames}") for nolinks in ( 0, 1 ): print(f"Invoking 'textOverflows' with 'nolinks' parameter set to {nolinks}") for frame in ( 'Text1', 'Text2' ): if scribus.textOverflows(frame,nolinks): print(f"{frame} is marked as overflowing") else: print(f"{frame} is not marked as overflowing") print("\n") if __name__ == '__main__': main_wrapper(sys.argv)