Is it possible to create a new file using the XML via java Script?

Hello everyone,

Is it possible to create a new file using the XML via java Script

  • I have xml information that need to use for file name, size.
  • Based on xml file we can create a new file in InDesign with java script?
  • Kindly help me if anyone has an idea about this.

I use InDesign CS4 on windows 7

Sample file is attached below.

Kind regards

Siva

<UpdateAd>
<AdId>3403699</AdId>
<Width type="mm">91,79</Width>
<Height type="mm">80,00</Height>
<ProductionCategory>4</ProductionCategory>
<BookedCCIColors>sw</BookedCCIColors>
<WorkFlowType>PDF</WorkFlowType>
<CustomerNumber>652224</CustomerNumber>
<CustName1>Erich Prang</CustName1>
<Description/>
<Description2>R</Description2>
<UpdateIns>
<Titel>RHZ</Titel>
<Publication>B2</Publication>
<RunDate>26-07-2011</RunDate>
<Zone>H30</Zone>
<KDDATEN>nein</KDDATEN>
</UpdateIns>
<WorkflowStep>IR</WorkflowStep>
<Proof>No</Proof>
</UpdateAd>

xml.png

Try this:

var f =File.openDialog ();
f.open('r');
var xml = new XML(f.read());
f.close();

var myDocument = app.documents.add();
myDocument.documentPreferences.pageHeight = xml..Height+"mm";
myDocument.documentPreferences.pageWidth = xml..Width+"mm";
var rect = myDocument.pages[0].rectangles,add();
rect.geometricBounds = myDocument.pages[0].bounds;
rect.strokeAlignment = StrokeAlignment.INSIDE_ALIGNMENT;
rect.strokeColor = myDocument.swatches.item("Black");
rect.strokeWeight = 1;
myDocument.save(File(f.path + "/" + xml..AdId + ".indd"))

Substances

Tags: InDesign

Similar Questions

  • Is it possible to create a PDF file using only the pages of an existing PDF?

    Is it possible to create a PDF file using only the pages of an existing PDF?

    Hi drdanger,

    There is a way, and it requires Acrobat. You need Acrobat to extract pages from a PDF. You are welcome to try free for 30 days, Acrobat, if you haven't already. See www.adobe.com/products/acrobat.html for more information.

    If Acrobat, you choose extract in the Pages of the Toolbox pane, then specify which pages you want to extract. These pages are extracted to a new PDF file, which then you name and save it.

    Best,

    Sara

  • Have Microsoft Office and Open Office installed, try to create a new file, but the Open Office program is not on the shortcut menu

    I have a Windows 7 computer with Microsoft Office and Open Office loaded on the computer.  When I'm in a folder, select the file menu and select new to create a new file, I offer myself to all programs open Office but only Microsoft Excel from Microsoft Office programs.

    It started only recently and I don't know what I did to bring about change.  Previously I was offered all Microsoft Office programs.

    I would go back to the situation where I offer Microsoft Office programs,

    How can I do this?

    Cecil Quillen

    Original title: new offers of file

    Hi Cecil,

    I suggest you to run the program install uninstall fixit in the link, and then uninstall all Open Office.

    This fixit will not only uninstall the software, but also delete the related to the software registry keys.

    Method 1: Solve problems with programs that cannot be installed or uninstalled http://support.microsoft.com/mats/Program_Install_and_Uninstall/

    a. download and run the fixit.

    (b) when requested, select the option: detect problems and apply the patches for me (recommended).

    c. click Next.

    d. select the Option: Uninstall.

    e. in the non-exhaustive list, choose the Open Office software and click next to Uninstall.

    f. Once done, restart the system and check.

    Method 2:

    After you uninstall Open Office, try to repair Microsoft Office and check.

    a. click Start , then type appwiz.cpl in the start search box and press ENTER.

    (b) this will open the window, uninstall a program . Select Microsoft Office , and then click on change.

    c. follow the instructions on the screen and then repair Microsoft Office.

    d. restart the computer once the repair completed and check if that helps.

    Method 3:

    Set the Microsoft Office as a default value by using the link.

    Change the programs that Windows uses by default

    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default

    It will be useful.

  • Make a new file using the "Save as".

    Bit of feedback to the staff HERE...

    We use LabVIEW 8.6. and, at least in this implementation, trying to make a new VI using the command save as product a menu of choices, including none make sense to me. Sorry, but I can't say which of them will produce only makes a new file with a changed name to be refined. Trial and error product folders, but not files, replaces the original file (why would I do that, I chose save as no record) and about each result other than what I was trying to accomplish.

    May you fix this in a future release, but for 8.6, I feel that I must take a class just to save the new file.

    you're not alone...

    Have you tried "open extra copy?  This is probably what you want.  It will not copy the original and will keep the open source.

  • Cannot create a new folder using the link on command bar (Win 7) over problem of saving files newly downloaded into the folder of choice

    Greetings! And thanks for your visit. I was not a happy camper since my toys have acted toward the top. And eating too much of my time, with too few results. Here we go:

    • I'm unable to create a new folder or get No response after clicking on "new folder" on the command bar in Windows 7 (Professional).

    Nothing happening... not even an error message.  I can enter the existing folders (where individual files) but as I'm trying to create a new folder to put them in, I write off. But that's not all. There is another mystery plaguing my system (and I suspect that these two are related).  I am naïve about how to remedy the situation:

    • I can not save files to my desktop (x) - favorite mainly files I just downloaded and am trying to save;

    I get an error message indicating "you don't have permission to save to this place... you want to save it to My Documents instead? (No, I wouldn't.)  I'm connected with my regular user profile (which has administrator privileges). Yes... I checked in the user accounts and verified. (I am the only user on the system, in case this has an impact on the problem. Not sure if I should create a "dummy" another user without administrator privileges, but just throw that out there.) This seems to be mainly when I am trying to save a downloaded file or the executable file.

    I can if not create and/or move files without problem; It's just not very welcoming for new downloads.

    Between these two issues, I'm not having fun with this all-in-One Dell Optiplex (new).  She is on a home network and the only thing I have
    reminder to do recently is to join the homegroup with one of the other Win 7 PC on the same network. Maybe this related to not having 'permission' to save in some places? Or create new folders? I'm the kind of feeling sad and rejected...

    Any ideas or suggestions would be appreciated. FYI: I try not to visit the registry on my own I do not have a Guide of techno-GPS with me. I sailed quite well on my own otherwise, provided that I the registry (or any what presses along the way.) Please think about this and do the right thing. I'll wait here with my turn signals on.
    Ciao

    Hello

    You have discovered a problem with Windows 7. To resolve this problem, I use a program called FileMenu Tools. You can download the portable freeware from here: http://www.softpedia.com/get/PORTABLE-SOFTWARE/System/System-Enhancements/FileMenu-Tools-Portable.shtml .

    After having downloaded and installed the program, you will notice that, by default, each option is checked. I would be much more selective on this subject, otherwise your context menu will be a full page long! When the main window opens, you will see a list on the right side of all the elements that can be added to the context menu. Start weeding through the list and every one to take away, you don't need the United Nationsby checking the box.

    Once you have completed your selection (de-selections) make sure that you click the green check mark in the row of icons at the top of the left window of the interface to 'Apply' of your choice. The program can do much more, but that answers your specific question. I am told that the program has a good help file, so try here if you are interested.

    Let me know if this solves the problem for you.

    Kind regards

    BearPup

  • Create a log file during the execution of a script from one day to the next

    I have a script running on 1000's of images every night, and I want to generate a log file.

    Is it possible that someone can suggest where it will be to connect what file it opened and successfully completed and mark the date and time for each of them along the way?

    Here are the basics...

    //Create logfile on the desktop
    var Loginfo = new File(Folder.desktop + "/Script Log.txt");
    Loginfo.open("w", "TEXT", "????");
    //Write the date and time to the log
    Loginfo.writeln(new Date());
    //Close the log
    Loginfo.close();
    
  • Create an image slider using the XML file photo gallery

    Hello!

    I have created a photo gallery and generated an xml file.  I want to implement a cursor image on the home page that performs a simple fade from one image to the other.

    I'm not an expert on jQuery. The BC help section says to add code that retrieves in the XML file and THEN add another code query j who would style images and transitions.

    I don't know how to do this.  Here is my code and it does not work.

    If you have a simple solution, it would be great.

    There is a script called JSSOR

    "< script type =" text/javascript"src ="... / js/jquery-1.9.1.min.js "> < / script >"

    <!-use jssor.slider.mini.js (40 KB) instead for immediate release->

    <!-jssor.slider.mini.js = (jssor.js + jssor.slider.js)->

    < script type = "text/javascript" src = "javascripts/jssor.js" > < / script >

    "< script type =" text/javascript"src="javascripts/jssor.slider.js "> < / script >

    This is the beginning of the code BC gives to pull from the xml file into a div called "Gallery".

    < div id = 'Gallery' > < / div >

    < script type = "text/javascript" >

    {$(function()}

    $.ajax({)

    type: 'GET ',.

          url: " http://www.performanceaire.com/Fahrenheit-images/BannerGallery/Photogallery.XML ", / / replace with an absolute URL of the XML of your gallery of .

    data type: "xml."

    success: {function (xml)}

    {$(xml).find('img').each (function ()}

    location var = ' http://www.performanceaire.com/Fahrenheit-Images/BannerGallery/'; / / Replace with the absolute path to the directory that contains your images

    var url = $(this) .attr ('src');

    var alt = $(this) .attr ('alt');

    $('<li></li>').html (' < a href = "' + place +" + url + ' "> < img src ="' + place + "+ url + '" alt = "' + alt + '" / > < / a > ').appendTo('#gallery');

    });

    }

    });

    });

    This is the code taken from JSSOR to transitions occur, and it does not work... any ideas?

    jQuery (document) .ready (function ($) {}

    var options = {}

    $AutoPlay: true, / / [optional] If auto play, to activate the slide show, this option must be set to true, the default value is false

    $DragOrientation: 1 / / orientation [optional] to drag the slide, 0. drag, 1 horizental, 2 3 vertical or, default value is 1 (note that the $DragOrientation must be the same as $PlayOrientation when $DisplayPieces is more than 1, or in the parking position is not 0)

    };

    var jssor_slider1 = new $JssorSlider$ ("Gallery", options);

    });

    < /script >

    www.performanceaire.com/index-FS.html

    It is perhaps a bit much if you do not top:

    Developers

    http://www.BusinessCatalyst.com/BC-blog/BC-next-liquid-rendering-JSON-new-editing-capabili links-increased-performance

  • How can I create a new file interactively in LabVIEW 2011?

    I am trying to create a new binary file interactively in LabVIEW, but control of path only gives the opportunity to type the path name and the complete file (cumbersome for the user) or search for an existing file. I want to open a dialog box "New file", which will allow the user to navigate to the target folder, and then be able to enter the name of a nonexistent file to save the data of.

    The way I'm currently doing it is to create a TXT using Windows Explorer file "New text Document" pop up, then change the file extension for the new value... which is once again, very heavy.

    The only thing I've found online is that there used to be a "new File.VI" in an earlier version of LabVIEW apparently... but I can't seem to find it in 2011.

    You can create a new file using the Browse button.

    Your right click the file path control and check the settings in the menu "Options to browse?

  • Create a PDF file using Add-ins Word2010 AcrPro8

    Hello people, I have a problem with Acrobat 8 Pro or Word 2010.

    I want to create a PDF file using the Add-in "add-in" which comes with Acrobat 8 Pro.

    But it won't work. What I need to upgrade to a newer version of Acrobat or it is usually possible to do?

    Any help would be very nice

    Each version of Word needs a new PDFMaker, so he was not one for Acrobat 8 and Word 2010. There was an update to Acrobat X (10) for Word 2010. See supported web browsers and applications of PDFMaker

  • How to create a PDF file from the Clipboard in Adobe Acrobat Reader ms?

    Is it possible to create a PDF file from the Clipboard in Adobe Acrobat Reader ms?

    No, Acrobat Reader cannot create PDF files.

  • action with the new file with the size of the selection

    Hello

    I try to record an action that takes a copy of the image and creates a new file with the same dimensions. The action record always have the size of the file of the new hardcoded image inside. I tried to put the Preset in the Clipboard, but this is not recorded in the action. It is with the CS3 version.

    How can I create a new file that takes into account the size of the image?

    Thanks for your help,

    Daniel

    You can save the menu 'Image-duplicate"to make a copy of the entire image without registration of the size. If the doc doesn't have only one layer, you can also save the context menu in the layer panel to duplicate the layer to a new document. The size is not saved.

  • create a txt file in the client machine

    Hi all

    I have


    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE 9.2.0.6.0 Production
    AMT for Linux: release 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production


    I want to create a file in my pc with utl_file for example

    {

    CREATE OR REPLACE PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE. TYPE_DE_FICHIER;
    BEGIN
    v_MyFileHandle: = UTL_FILE. FOPEN ("C:------',' myfile.") TXT', 'w');
    UTL_FILE. Put_line (v_MyFileHandle, "something must printed");

    UTL_FILE. FCLOSE (v_MyFileHandle);
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. PUT_LINE ('ERROR' |) TO_CHAR (SQLCODE) | SQLERRM);
    NULL;
    END;


    }

    could you please help me, I'm new.


    Thank you

    Hitesh

    Your code looks OK and also fine requirement. You can create a text file on your PC, if you are working on the server or client.
    It works fine without any problems abs. The only thing to be supported is the path of directory and file mode.

    1 directory path - it must be created on the Oracle server, pointing to the location of the target file you. If target is the customer, you must use the name of the computer and the relative path to create the directory as below. If your machine name is CLIENT001 and the target location is C:\Test, then your directory must be on the server (as sysdba)

    conn uname/pass as sysdba
    create directory mydir as '\\CLIENT001\TEST\'
    

    Because file access operations are supported by the server, so the server must have read/write access on the directory path. In the direct words, target your path on the cleint must be shared for access to the R/W server.
    Also grant read, write on directory access to the user who executes the procedure UTL_FILE.

    2. If you want to create a new file on the location of the target file, it must be open in write mode (w) only. You have already done, which is correct.

    That thing you can change is the directory in your code and move forward. It should work properly

    CREATE OR REPLACE PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('C:\','myfile.TXT','w');
    UTL_FILE.PUT_LINE(v_MyFileHandle,'some thing should printed ');
    
    UTL_FILE.FCLOSE(v_MyFileHandle);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR ' || TO_CHAR(SQLCODE) || SQLERRM);
    NULL;
    END; 
    
  • BlackBerry Z3 can I create a Blackberry ID using the same email address, but with a different password?

    I use 2 phones and I am ready to create a new blackberry on the 2nd ID, but it requires an email address and I don't have that one email address that I use for everything. I want to know if it is possible to create a new BBID with the same e-mail address but different password. The main thing is I want both phones to be active and fully functional, but I don't have a single address email and I prefer not to create another email address, because I love all of my emails in one place rather then having 2 email addresses. I don't want any phone be disabled. I do not fear one of the BBM is turned off, as long as at least one works. Both phones are a Blackberry Curve 9320 and a Blackberry z10, which is one waiting to be activated.

    No this is not possible. The BBID, you use is associated with the device, you are using, the e-mail address is the user and cannot be associated with two BlackBerry smartphones to consider it time of the password.

    I suggest that you create a new e-mail address for the sole purpose of using it as a BlackBerry ID.

    www.bbid.com

  • BlackBerry Z10 can I create a Blackberry ID using the same email address, but with a different password?

    I use 2 phones and I am ready to create a new blackberry on the 2nd ID, but it requires an email address and I don't have that one email address that I use for everything. I want to know if it is possible to create a new BBID with the same e-mail address but different password. The main thing is I want both phones to be active and fully functional, but I don't have a single address email and I prefer not to create another email address, because I love all of my emails in one place rather then having 2 email addresses. I don't want any phone be disabled. I do not fear one of the BBM is turned off, as long as at least one works. Both phones are a Blackberry Curve 9320 and a Blackberry z10, which is one waiting to be activated.

    No this is not possible, the e-mail address you used your BBID, is associated with the device that you use it on. It is also the BBID username. And cannot be used on another device, no matter that there is a different password.

    I suggest that you create a new e-mail account, just for the sole purpose of using it as a BBID.

    www.bbid.com

  • I have a list of files on the left side and I am trying to create a new file. Whenever I create a new file, it will in a list/topic - as creating a

    All I want to do is create a new file and do appear in my existing list of files instead of a new file under a new title.

    I am trying to create a new file and it appears in the sent column where my files for e-mail are listed. Now he goes over these files under a different title every time creating a new file.

Maybe you are looking for

  • I have a random popup, saying that the computer is about to go to sleep!

    It is a sign of letting go... I get this popup, even when I don't plan the computer to sleep! Thinking that he can replace the corrupted prefs. I tried to program the Mac to sleep at one time. Of course, I got the popup indicator. I cancelled. Return

  • HP connected - what software does this replace?

    I have a Windows 7 laptop, Android phone and iPad and I have access to my printer wirelessly with all three devices. Today, I have connected the HP ePrint center and received a message that I want to join connected HP. I like to keep my systems tidy,

  • Need 1024 x 600 1024 x 768 screen resolution

    Have a screen of 1024 x 768 on graphics controller Intel (r) 82852/82835 GM/GMR. My system tells me that my drivers are up to date. My screen resolution is at 1024 x 600 then available on slider is 1152 x 864, which is of no use to me. I used to only

  • Z61p - Maximum HARD disk capacity

    Hello I had a Z61p with 100 GB HARD drive. I want to spend to 320 GB or 500 GB HARD drive. Do you know that my computer supports these capabilities or not? Kind regards Muharrem.

  • Decrypt EFS in Windows 7 questions.

    Hello Sir, I have a problem with the decryption, previously I have windows xp installed, where I use the EFS encryption to encrypt the data so I'll be switch to windows 7, and now I can't decrypt my data.Can you please help, how do I get my data back