Article View: adobe.scripting.indesign
Article #2034Re: Insert Text Variable
From: Thomas_B._Nielsen
Date: Wed, 14 Jan 2009 14:21
Date: Wed, 14 Jan 2009 14:21
16 lines
1269 bytes
1269 bytes
Found a solution:
try {
myVar = myDocument.textVariables.item("Last Page");
myVar.name;
} catch (e) {
//alert(e);
myVar = myDocument.textVariables.add({name:'Last Page', variableType:VariableTypes.LAST_PAGE_NUMBER_TYPE});
myVar.variableOptions.scope = VariableScopes.DOCUMENT_SCOPE;
}
myFoundItems[i].parentTextFrames[0].contents = SpecialCharacters.autoPageNumber;
myFoundItems[i].parentTextFrames[0].contents += "/";
myFoundItems[i].insertionPoints.lastItem().textVariableInstances.add( {associatedTextVariable : myVar} );
If anyone can tell me how i can use the application text variable "Last Page Number" without having to make a document variable, please post.
Technical Details
Message-ID:
<59b782b5.1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b782b5.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,ca3ed841f5ed21c8 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Thomas_B._Nielsen@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Insert Text Variable Message-ID: <59b782b5.1@webcrossing.la2eafNXanI> Date: Wed, 14 Jan 2009 06:21:33 -0800 References: <59b782b5.-1@webcrossing.la2eafNXanI> Lines: 20 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit