<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#336666">
<div class="moz-cite-prefix"><font face="Verdana">Hi Adam...<br>
<br>
You'll need to get the variable definition value from a document
in the book, not the book itself, so you'll need to set up some
process to iterate through the book components and get an
appropriate document (perhaps the first non-generated component?).
Once you get the document you can open it and query it for the
value of the variable definition using something like this ..<br>
<br>
var doc = app.ActiveDoc;<br>
var varFmt = doc.GetNamedObject (Constants.FO_VarFmt, "Issue
Number");<br>
var varValue = varFmt.Fmt;<br>
<br>
If you haven't already, you'll want to grab the samples
graciously provided by Russ from West Street Consulting ..<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.weststreetconsulting.com/WSC_ExtendScriptSamples.htm">http://www.weststreetconsulting.com/WSC_ExtendScriptSamples.htm</a><br>
<br>
Good luck!<br>
<br>
...scott<br>
<br>
</font>
<pre class="moz-signature" cols="72">Scott Prentice
Leximation, Inc.
<a class="moz-txt-link-abbreviated" href="http://www.leximation.com">www.leximation.com</a>
+1.415.485.1892
</pre>
On 7/15/14 12:51 PM, Adam Hollett wrote:<br>
</div>
<blockquote
cite="mid:185C16D6C8CDC145B438CB1CEE3C0CC18A30A7077F@AUSP01VMBX49.collaborationhost.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Arial","sans-serif";
font-variant:normal !important;
color:windowtext;
text-transform:none;
position:relative;
top:0pt;
mso-text-raise:0pt;
letter-spacing:0pt;
mso-ligatures:none;
mso-number-form:default;
mso-number-spacing:default;
mso-stylistic-set:0;
mso-contextual-alternates:no;
font-weight:normal;
font-style:normal;
text-decoration:none none;
vertical-align:baseline;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">Hey
there!<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">I’m
a technical writing student just getting my feet wet in a
work placement. One of the things I’ve been doing is trying
to improve the workflow here and cut down on repetitive
tasks.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">To
that end I’ve created an ExtendScript which grabs the most
recent version of each of our 18 FrameMaker documents and
saves them as PDFs in a network folder.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">All
of our books feature an ‘Issue Number’ variable which
indicates if there have been any revisions to the document
since the last product release. The issue number is featured
in the output PDF’s file name. Right now the script contains
a record of each issue number which it inserts, but this
must be updated manually any time the FrameMaker files are
updated.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">The
script iterates through the list of books that I have, opens
each book and saves it as a PDF. What I would like to have
it do is grab the value of the ‘Issue Number’ variable from
each book just before it is saved and include that number in
the filename, rather than the number which is currently
manually specified as a book property in the array of
FrameMaker documents.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">This
is my first time using JavaScript or ExtendScript. Google
has been helpful with scripting but I haven’t been able to
Google this particular issue because any search I make that
includes the word ‘variable’ inevitably gives me results
discussing JavaScript or ExtendScript variables rather than
specifically FrameMaker variables.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">Any
ES experts out there able to throw me a line?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif"">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Arial","sans-serif";color:#404040;mso-fareast-language:EN-CA"
lang="EN-US">Adam Hollett<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#F8991D;mso-fareast-language:EN-CA"
lang="EN-US">Customer Documentation<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#005DAB;mso-fareast-language:EN-CA"
lang="EN-US">Solace Systems<o:p></o:p></span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>