Doubt in Document in Template

Hi All,
I am the beginner. I am studying through "InDesignCS3_ScriptingGuide_JS".
In page no 13, there is script 'save a document as a template'
Below script i am not able to understand, Can anyone explain it breifly if you willing.
Lines are below.
var myFileName;
if(app.activeDocument.saved == true){
//Convert the file name to a string.
myFileName = app.activeDocument.fullName + "";
//If the file name contains the extension ".indd", change it to ".indt".
if(myFileName.indexOf(".indd")!=-1){
var myRegularExpression = /.indd/gi
myFileName = myFileName.replace(myRegularExpression, ".indt");
Thanks in advance for all you read my scripts.
Thanks
BEGINNER

well..
the script is very well commented..
if(app.activeDocument.saved == true){
checks if the current active document is saved. This is important because "Unsaved documents have no full name".
myFileName = app.activeDocument.fullName + "";
the fullName property of a document object returns a File object. This line converts that File object to a string (-containing the full path including the file name). The implementation is a bit unorthodox (don't think you will find it in many JavaScript books), but it works. Another way of doing it is: myFileName = app.activeDocument.fullName.toString()
if(myFileName.indexOf(".indd")!=-1){
checks if the string previously obtained contains ".indd". the indexOf() method of the String object returns -1 if the search string is not found. The problem here (and in the next lines) is if the file name is somenthing like: "myStrangeFile.indd.modifiedByStupidUser.indt"
for the rest of the lines I direct you to any general JavaScript beginner tutorials/books. A good reference: http://www.javascriptkit.com/jsref/

Similar Messages

  • New Document Type Template PHP Class

    How do I create a new document type template for a PHP class
    in Dreamweaver CS3?
    I want to be able to go File -> New -> Blank Page ->
    PHP Class.
    I want the template to then look like:
    [code]
    <?php
    class Classname {
    //Class Member Variables
    //Constructor
    public function Classname() {
    //Methods
    ?>
    [/code]
    Thanks.

    Bumb, anybody?

  • The document "Blank.template" could not be opened. in Pages

    I can not open any tempaltes in Pages from iWork on Macbook Pro.
    When I open pages. I can then pick a template. when I click that or any of the templates I get
    The document “Blank.template” could not be opened.
    I am new to the Mac world and trying to set up for my son to do homework. So please bear with me if I ask a lot of questions.
    I reloaded the software and still get the same reply. Any help to get it running would be a HUGE help.

    Mitch,
    See if you can run Pages successfully in another User account. If so, you have a corrupt PLIST file in the main user acount.
    I have a hunch that this is your problem since reloading the software didn't solve the problem. But, I have to ask if you may have moved Pages.app from where the installer put it.
    Jerry

  • Unable to see SAP BusinessObjects Document Viewer template in 7.4 portal

    Hello Experts,
    We are looking to integrate dashboards created with BOBJ design studio into enterprise portal (NW 7.4). We have followed the steps mentioned in the blog Integration of BOBJ with SAP Portal.
    Namely:
    1. Taken the com.sap.businessobjects.iviews.par and com.sap.businessobjects.iviews.templates.epa files from the BI server
    2. Imported the EPA file into the portal
    3. Converted the com.sap.businessobjects.iviews.par file into EAR file and deployed it into the portal
    4. Created System alias for the BI system
    5. Configured SSO between portal and the BI server
    After doing these steps when trying to create the Business Objects iView we are unable to see the SAP BusinessObjects Document Viewer template in the portal. Can anyone let me know if we have missed some additional configuration that has to be done?
    Regards,
    Saurabh

    Hi Experts,
    Issue has been resolved. After importing the EPA file into the portal, we missed out restarting the portal. Once this was done I am now able to find the SAP BusinessObjects Document List and SAP BusinessObjects Document Viewer templates in the iView creation wizard.
    Regards,
    Saurabh

  • Issue with Document from Template

    Hi Friends,
      I am using a Document from Template step to display a set of records in my Workflow. For this i have a created a template of type excel sheet and i have linked the multi line container element from my workflow to this template. But i am not able the view the records in
    sequence.Lets say my multi line container element has the following 2 records:
    WEATH_ZONE     02/01/2008     03/31/2008     ABC
    BACKACST        03/01/2008        03/31/2008        123
    Once i execute my Workflow i am getting the values appended in a
    single row in excel sheet as follows.
    WEATH_ZONEBACKACST     ABC123     02/01/200803/01/2008     03/31/200803/31/2008
    But i need them in the same format as above.Please let me know how i can solve this issue.
    BTW I have done the linking in the template as follows where Str is my multil ine container element and the values after dot is my fields.
    {&STR.OPERAND&}     {&STR.UDEFVAL1&} {&STR.FROMDATE&}     {&STR.DUEDATE&}

    This workaround worked for me:
    You need to enter manually a ## behind your element.
    For example if your multiline element is :
    {&BUS2012.REPORTDESCRIPTION&}
    You need to insert a ## in the element (in the word-document), like this:
    {&BUS2012.REPORTDESCRIPTION##&} .
    Hope it helps you,
    Bert

  • Workflow - create document from template

    Hi,
    Could anyone tell me what could be the possible use of Create Document from Template step in workflow...

    Hi vijay,
    1)Open the PC application by choosing the entry Double-click to create in the Document templates tray by double-clicking or choose  in the step definition of the document generation.
    The PC application that you last used to create a template is opened in the Workflow Builder. The system fields and the container elements of the workflow container are offered for selection in the navigation area. They can be transferred into the template by double-clicking.
    You cannot use any multiline container elements in your template.
    All relationships created between container elements/system fields and the document template are displayed in the object area.
    It is not possible to insert system fields and container elements into all types of document template.
    2) If you want to create a document template of a different class, select  Change document class and choose the new type of document template.
    3) Select  to assign a name for the document template.
    4) Create the document template in the usual way in your PC application. You can use all the functions of the PC application.
    5) Insert container elements and/or system fields from the object area into your template by double-clicking. These fields are replaced with the content of the container elements/system fields at runtime.
    6) Select  to save your document template.
    Hope this helps u,
    Regards,
    Nagarajan.

  • Workflow - document from template step not working properly

    Hi All,
    We are creating a document from the step "Document from a template" in our workflow .
    This document is then given to the user as an attachment to a user decision step where he modifies that document.
    These modifications to the document are stored in the workflow.
    However if i want to give the same document to another user in another user decision, it gives only a read-only copy to him. Is this how a document from a template works or is there some bug in my coding or a possible workaround
    Thanks and regards,

    Hi Amit,
    Have you tried option from menu Document -> load other version , when user opens work item for document from template?
    I think this should serve the purpose of making document editable for other users.
    Hope this helps.
    Regds,
    Akshay Bhawgat
    PS: Some points would be nice if it helps:)
    Message was edited by:
            Akshay Bhagwat

  • PLD Document Configuration Template

    Hi All,
    Can anyone please let me share any of the PLD Document Configuration Templates. This is for requirement documentation. Based on this we would like to design the SBO outputs for all the marketing and other documents. Any help would be of great value.
    Thanks & Regards
    Shiva

    Documentation can found in this link:
    https://websmp206.sap-ag.de/smb/sbocustomer

  • Multiline variables are truncated in a Word task " Document from template"

    Hi everyone,
    I’d like to know if somebody have had the situation described below and how can I solve it.
    The problem is when I try to write in a word document (task created as a Document from template) a container element declared as a Abap dictionary referenced as TLINE-TDLINE (Char 132) with multiline flag activated, because when this variable has more than 3 lines during the execution of the workflow, the word document doesn’t gets the  whole value, it means the value is truncated and the word document just write or get 2 and a half lines (almost 350 or 400 characters)  and I don’t know why the rest of the value of this variable is missed.
    Does somebody knows what could be happen?, Does SAP have some kind of limit of the amount of characters to be written in a word document with a multiline variable? There’s a bug in the system and a “note”  to be applied? What can I do to write a variable wit multiple number of lines without missing any one?
    Thanks  a lot for your help.

    I have had a formal answer from SAP (OSS Note) for this issue, and It is no good at all to me (notes 375669, 559234, 724755);
    1.     There’s a restriction on the length for text variables 80 characters
    2.     to implement a long text you need to put several variables together
    If any one has another solution, I would appreciate your comments.
    Thanks a lot
    Felipe Uribe

  • Create Dynamic Document Library Templates

    I have the following scenario within our IT Org
    1. PMO office maintains a "Standards" library, to which they publish all standard templates that need to be used for Project Management.
    2. Each Project Manager would like to create a document library within their "project site" based on all the documents within "Standards" library.
    My question is, would it be possible to create a document library template whose contents are dynamically pulled from another library?
    Thanks.

    Hi ,
    Based on your description, my understanding is that each Project Manager
    creates document library with the same template, but what they need is that their document libraries have different content type with others.
    There isn’t an out of the box method to create document library templates dynamically.
    For your issue, I suggest each Project Manager create one document content type with the document template which they need, and add the content type into their document libraries. 
    Here is a similar case, you can use as a reference:
    http://social.technet.microsoft.com/Forums/en-US/7d238bb5-8af7-4027-97cf-b41f84bcdb5d/dynamically-create-document-templates-for-new-menu?forum=sharepointdevelopmentlegacy
    Best Regards, 
    Lisa Chen

  • Cannot save any jpeg, tiff or other formats except document or template (suddenly today)

    I created a file in InDesign and went back to it the next day and discovered that I only had two options for save or save as: InDesign CS5.5 document and InDesign CS5.5 template -- I am not able to save in any other file formats.  I followed some online advice that said to hold down the ctrl + alt + shift key and when the dialog box came up chose to delete preferences-- it was said that would restore the original settings which did not happen.  I am still only have two options (document of template) to save or save as.  Any help is appreciated!  Thank you

    I see -- I just tried that and it worked, but I never had to do that before -- I don't know what happened! I have always been able to "save" or "save as" and there is a long list of choices there that have disappeared overnight!  Thank you for the export work around -- I will use that until I can figure out how to get my other options back!  Thank you for responding!!

  • Create document from template without launching Adobe Bridge (InDesign CS4)

    When I select "New Document from Template...  while using InDesign CS4, Adobe Bridge launches instead of a search menu.
    It's much harder for me to navigate through Bridge than it is with a standard New menu. How can I get InDesign NOT to launch Bridge when this happens?

    Just use File > Open... and navigate to the template you want to use.

  • Convert a Document into Template

    As far as I know to save any document to create a template with a dot extension. I want to know is there any better idea and any quick way to convert a document into template because every day I had to make many template for my business purpose. So any one will suggest me a better way so that a document will be converted as a template in quick time it will make-work easy.
    Thanks in advance.

    HI,
    Well, saving any document you wish to use as a template with the .dot extensions is a good idea. Now as you want to know a quick way to make a document a template to make your work easy and faster, I thing you will get help from the site http://www.templatesforbusiness.us

  • If you create a 3 level deep site heirarchy (with the first two levels based on the document centre template) the sharepoint OOTB breadcrumbs break

    if you create a site collection with document center as the template, then create another document center site (as a subsite) underneath it. Then create a team site (as a subsite) in this document center site. So now you have a 3 level deep site heiarchy
    with 2 levels of doc center followed by a teamsite.
    Note that the breadcrumb (when I say breadcrumb I mean the drop down folder button which shows the heirachy) shown on the teamsite skips the middle level doc center.
    I have replicated this bug in production and in my test server.  Has anyone run into this before?  This must be something peculiar with the Doc Center template.  If I do the same thing but I make the middle level a team site I do NOT have
    this problem
    krd

    Hi,
    Per my test, it seems that if the second level uses a different category template except the Collaboration templates, the site will not show on the breadcrumb.
    No matter if the first level uses any template, when we view the subsite which uses the Collaboration templates, all the subsites which uses a different category template above will not show in the breadcrumb.
    You can create your own breadcrumb using code.
    http://blog.mastykarz.nl/building-breadcrumbs-sharepoint-2010/
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • How do I use a jpeg as a document background template

    How do I use a jpeg as the background for a Business Letterhead. Can I save that letterhead document as a template?

    In what application on what Mac running what version of OS X?

Maybe you are looking for

  • ATI 9600 XT and Dell 3007WFPHC

    Hi, My company just bought us all new 30" Dell monitors. Great! I cannot get more than 1200x800 out of mine. I have updated the firmware and drivers on the ATI 9600XT in my G5. Looks like my Mac is recognizing the monitor correctly. Is the ATI not ca

  • Changing of R/3 PS Object Names affects BW reporting

    Hi all Would like to ask for some help on PS Objects in R/3 and BW. Current we are running BW 3.0B in Production, and we hit this issue on PS objects. In R/3, names for PS objects such as Project Definition, WBS Element, Network Activity and Network

  • Break point in enhancement

    hi all, How do we set a break point in a enhancement. When i try to create a break point I am getting a message 'THE POSITION OF THE BREAK POINT CANNOT BE DETERMINED' I know that the code in the enhancement point is in a include program. but how do i

  • Alter css stylesheet to change rollover colors

    I know how to change the rollover colors for links that I've created myself using the inspector, than links/format tabs. But I'm customizing a blog using the notebook template, mostly because I liked the font that it used more than the other blogs. I

  • Downloading iCal file on iPhone and creating an new calendar to add it under?

    I am trying to download an iCal file on my iPhone and add it to my calendar on my phone. I was wondering if I can create a new calendar within my iCloud calendar on my phone and add it to that, instead of it automatically adding to my normal calendar