<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thank you for your reply<br><br>I have written scripts already, for various tasks, but am still very much an amateur so thanks for all help.<br><br>Looks like I'll have to go with a work around solution - will experiment with fileDialog...<br><br>Just so you know, ultimate objective was simply to open a doc then run a script named something like 'write page info'.<br><br>Running the script would write certain data into a text box at the bottom of the page, including the doc name.<br><br>Trying to avoid doing lots of cutting and pasting, which is what I'm doing at the moment - I have lots of small docs.<br><br>Thanks again for your help.<br><br>Regards<br><br>Mike<br><br><br><br><br><br><br><br><br>> Date: Thu, 9 Dec 2010 20:14:03 -0500<br>> From: gregp_ky@yahoo.com<br>> To: scribus@lists.scribus.info<br>> Subject: Re: [scribus] scribus script to write current document name<br>> <br>> On 12/09/2010 07:41 PM, Gregory Pittman wrote:<br>> > On 12/09/2010 03:08 PM, michael biggs wrote:<br>> >><br>> >> Hello<br>> >><br>> >> I am looking for some help writing a simple script.<br>> >><br>> >> With scribus running and a document open, the script will simply<br>> >> create a text box on a page of the open document, and then write the<br>> >> name of the document into the text box.<br>> >><br>> >> What python command can I use to automatically get the name of the<br>> >> currently open document?<br>> >><br>> >> All I've been able to get so far is the name of the python script that<br>> >> I run from the document.<br>> ><br>> > The short answer is that this does not exist.<br>> ><br>> > The longer experimental answer would be to set up a fileDialog something<br>> > like this:<br>> ><br>> > myfilename = scribus.fileDialog('My File Name', 'SLA files (*.sla)')<br>> ><br>> > which should at least bring up a way to find the SLA filename, and load<br>> > its name into myfilename, for you to use for your text frame.<br>> <br>> Another workaround (aside from typing in the name):<br>> <br>> _Before_ you run your script, go to File > Save As...<br>> <br>> which brings up a dialog with the current document name highlighted.<br>> Press Ctrl+C, then Cancel the operation.<br>> <br>> Now start your script, set up a valueDialog, then Crl+V for the saved name.<br>> <br>> Greg<br>> <br>> _______________________________________________<br>> scribus mailing list<br>> scribus@lists.scribus.info<br>> http://lists.scribus.info/mailman/listinfo/scribus<br>                                            </body>
</html>