[scribus] scribus script to write current document name
michael biggs
mjbiggs at hotmail.com
Fri Dec 10 10:33:38 CET 2010
Thank you for your reply
I have written scripts already, for various tasks, but am still very much an amateur so thanks for all help.
Looks like I'll have to go with a work around solution - will experiment with fileDialog...
Just so you know, ultimate objective was simply to open a doc then run a script named something like 'write page info'.
Running the script would write certain data into a text box at the bottom of the page, including the doc name.
Trying to avoid doing lots of cutting and pasting, which is what I'm doing at the moment - I have lots of small docs.
Thanks again for your help.
Regards
Mike
> Date: Thu, 9 Dec 2010 20:14:03 -0500
> From: gregp_ky at yahoo.com
> To: scribus at lists.scribus.net
> Subject: Re: [scribus] scribus script to write current document name
>
> 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
>
> _______________________________________________
> scribus mailing list
> scribus at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20101210/bbc66b9b/attachment.htm>
More information about the scribus
mailing list