[scribus] scribus script to write current document name

Gregory Pittman gregp_ky at yahoo.com
Fri Dec 10 02:14:03 CET 2010


On 12/09/2010 07:41 PM, Gregory Pittman wrote:
> On 12/09/2010 03:08 PM, michael biggs wrote:
>>
>> Hello
>>
>> I am looking for some help writing a simple script.
>>
>> With scribus running and a document open, the script will simply
>> create a text box on a page of the open document, and then write the
>> name of the document into the text box.
>>
>> What python command can I use to automatically get the name of the
>> currently open document?
>>
>> All I've been able to get so far is the name of the python script that
>> I run from the document.
>
> The short answer is that this does not exist.
>
> The longer experimental answer would be to set up a fileDialog something
> like this:
>
> myfilename = scribus.fileDialog('My File Name', 'SLA files (*.sla)')
>
> which should at least bring up a way to find the SLA filename, and load
> its name into myfilename, for you to use for your text frame.

Another workaround (aside from typing in the name):

_Before_ you run your script, go to File > Save As...

which brings up a dialog with the current document name highlighted.
Press Ctrl+C, then Cancel the operation.

Now start your script, set up a valueDialog, then Crl+V for the saved name.

Greg



More information about the scribus mailing list