How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

Hi hasvi,
Need Template(.indt), textframes etc for the following script:
var myFolderInd = Folder.selectDialog();
var myFile = myFolderInd.getFiles("*indt");
app.open(myFile)
var myDoc = app.activeDocument;
var myDocName = myDoc.name;
var mySaveFile = app.activeDocument.save(myFolderInd.fsName + "/" + myDocName.split(".indt").join(".indd"));
var myFolderDoc = Folder.selectDialog();
var myFile1 = myFolderDoc.getFiles("*doc");
mySaveFile.pages[0].textFrames[0].place(File(myFile1))
//~ mySaveFile.place(File(myFile1))
app.activeDocument.textPreferences.smartTextReflow = true;
var myPDFFile = new File(mySaveFile.filePath + "/" + mySaveFile.name.split(".indd").join(".pdf"))
myDoc.exportFile(ExportFormat.PDF_TYPE, File("~/Desktop/abc.pdf"));
alert("Process Completed")
Regards
Siraj

Similar Messages

  • How can I set ACR 5.2 to open RAW files as 16 Bit and not 8?

    Whenever I open RAW files in ACR 5.2 they open as 8 bit. I change the bit depth to 16 and work on a file... but when I open my next RAW file it's back to 8.
    Is there any way to set ACR so that it always opens my RAW files as 16 Bit.. and saves other settings as well?

    Bennett, when you open a raw file in Camera Raw and finish working on it the choices to click on are Open Image, Cancel, and Done. Which one are you clicking on to close the image in ACR? Cancel will do just that. Cancel the changes and the 16/8 bit setting will not be kept. The other two choices (Open Image and Done) will maintain the changes you made and the 16/8 bit setting and the color space should stick for the next image.

  • How can i write the below code using "For all entries"

    Hi
    How can we write the below code using "for all entries" and need to avoid joins...
    Please help
    SELECT aaufnr aobjnr aauart atxjcd a~pspel
    agstrp awerks carbpl cwerks
    INTO TABLE t_caufv
    FROM caufv AS a
    INNER JOIN afih AS b
    ON aaufnr = baufnr
    INNER JOIN crhd AS c
    ON bgewrk = cobjid
    AND c~objty = 'D'
    WHERE ( a~pspel = space
    OR a~txjcd = space
    OR NOT a~objnr IN
    ( select OBJNR from COBRB AS e
    WHERE objnr = a~objnr ) )
    AND a~werks IN s_plant
    AND a~auart IN s_wtype
    AND NOT a~objnr IN
    ( select OBJNR from JEST AS d
    WHERE objnr = a~objnr
    AND ( dstat = 'A0081'OR dstat = 'A0018' )
    AND d~inact 'X' ).
    Reward points for all helpfull answers
    Thanks
    Ammi.

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

  • How can i write this C-Code in G-Code

    hallo
    how can I write this C-Code in LabVIew ,
    for a=0; a=<10; a++
       for b=0; b=5 ; b+2
            X= 3+b;
      Y=1+a;
    please see the attachment and tell me where is the problem
    Attachments:
    Unbenannt 11.vi ‏43 KB

    Well, at least you tried and got some of it right.
    I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
    In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
    Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
    To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
    Try to take over the world!
    Attachments:
    C.png ‏4 KB

  • How can I write the analogous code to the logic:iterate tag functionality

    Hai This is Rayalu .And I am very new to the Java World. I have a doubt?.How can I write the analogous code to the<logic:iterate> tag functionality using the JSP Tag Libraries . Pleae Send me some examples .

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

  • How can I delete all javascript code from a file

    We need to delete all the javascript code from our illustrator files. Right now I need to click on each element and check my SVG interactivity window for any javascript code, then trash it from that window. Very time intensive. Any ways to make a complete elimination of javascript code?

    sudo -u _cyrus /usr/bin/cyrus/bin/ipurge -d 0 -f user/mailboxname
    HTH,
    Alex

  • How can I Write a sine wave in an Access-fil​e?

    I measure a sine wave in LabView 6i. How can I write the datas automatically to an Acces-file, at the same time?
    In my program, I managed it with Execute SQL.vi, I change a number in a SQL statement(String) -> after this I push start and then it writes the statement in the Access-file.
    The problem is, it writes only one data per measurement in the file. How can I write all datas in the Access-file and measure the wave at the same time?
    Thanks for help!
    Attachments:
    getwave.vi ‏49 KB

    On the waveform palette, you will find a "to components" vi that you can break out the array of the waveform. You can then, using a for loop write all of the values from the waveform.
    Better yet, there are examples in the database toolkit manual on pages 3-13 to 3-15 that deal with reading arrays (and even has a waveform example).
    Good luck!

  • HT201394 I just updated my iPhone 4s to iso 8.2  How do I create a pass code to open my phone without using my password every time?

    I just updated my iPhone 4s to iso 8.2  How do I create a pass code to open my phone without using my pass word every time?

    I couldn't find the edit button on my original post so I am posting an update here.
    I have gone through more apps and have had good luck on all but one more.  And it's not that the app doesn't work, I am talking about the Yahoo Weather app, It works fine, but when you swipe between cities the screen lags a bit and it sometimes doesn't move between pages the way it should.  On iOS 7.1.2 it was smooth as butter but on iOS 8.0, not so much.  I will post a note in the app store to let them know.  I really like the Yahoo app better than the new stock app.
    I have been going through my games and they all work fine. Angry Birds (Original and Stella), Canabalt, Minecraft, Bejeweled 2, Silly Walks, PopWords, Doodle Jump, Deep Green all seem to work just fine. 
    Starbucks app works as it should. 
    I will stop back again next week after I have had the weekend to play with it in detail and post my thoughts again.

  • In Mountain Lion, how do I find the location of an open Preview File?  The file "properties" tab is no longer available.

    I typically have several open Preview files at any one time and often forget where, sometimes if, I saved them.  In Mountain Lion, how do I find the location of an open Preview File?  Tried holding option + command in spotlight but I don't see a path name appear anywhere. 

    Yes, cmd-option on a file you choose in Spotlight and the path will appear at the bottom of the Preview window.
    EDIT: Also, if it is bookmarked the path is in Bookmarks.

  • In Elements 12, how do I get thumbnails to show when opening a file?

    In Elements 12, how do I get thumbnails to show when opening a file?

    When in iPhoto (photos, library, an album, whatever, etc.) and I try to position the thumbnails at the top of the page I am unable to do so. In the "View" menu of iPhoto, then "Thumbnails" at the bottom, then all the items in the menu are grayed out. I have tried to go to iPhoto prefences and try there, but no luck. I get the beachball turning for a few minutes, then it stops, but still no luck.
    I have iPhoto 08, OS 10.5.8, anda PowerBook G4, 17"
    Thanks, and sorry for the brief/incomplete question.

  • How do I import a camera video from iphoto to imovie? I went to file, import, camera archives and the video I want I am not able to select. I even tried dragging it from my desktop, but it will not allow me to do so. Please help?

    How do I import a camera video from iphoto to imovie? I went to file, import, camera archives and the video I want I am not able to select. I even tried dragging it from my desktop, but it will not allow me to do so. Please help?

    Use File/Import/Movie and navigate to the file.

  • HT4075 I don't have any problems merging the documents by dragging, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I tried save and export, how can I create the file after merging?

    Hi, I'm having trouble saving the documents when merging in Preview. I don't have any problems merging the pdf documents by dragging them in preview, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I've tried save and export, but none merge the documents after saving... how can I create the file (with all the pdf files) after merging?

    That's a comment in the file. It has no effect at all.

  • How do I design my posters on Photoshop touch for ipad, to be A0 and export them to creative cloud at the same size???

    How do I design my posters on Photoshop touch for ipad, to be A0 and export them to creative cloud at the same size???
    every time I do it it comes out at a fraction of the size and not even an A size...
    Please help

    A0 is pretty big if you go at a high DPI for printing. It's about 10000 x 14000 pixels at 300 DPI.
    PS Touch can handle about 12 Megapixel image imports (which is about 4000 x 3000 pixels). PS Touch, interestingly, can create 4096 x 4096 pixel projects from scratch.
    Adding to that, PS Touch always exports at 72 DPI. Take note that this is probably due to tablet hardware. Tablet hardware is "getting there" but it still has a ways to go before it matches its desktop cousin.

  • How do I let lightroom show the actrual number of files in a map and not a number including the total of all submaps?

    How do I let lightroom show the actrual number of files in a map and not a number including the total of all submaps?

    If by "map" you mean directory or folder, in the Library menu there is a toggle for "show photos in subfolders".

  • Multiple JavaScript errors when opening aspx file in Dreamweaver

    I get multiple javascript errors when opening aspx file in Dreamweaver similar to... "While executing translateHyperLink in ExternalRenderers.htm, a JavaScript error occurred."

    Hi Steven,
    Not sure if this is related, but can  you try the solutions in Troubleshoot JavaScript errors | Dreamweaver CS4, CS5, CS5.5, CS6
    Thanks,
    Preran

Maybe you are looking for

  • Cisco VPN Client and Windows XP Home

    Hello, I cannot find any information to tell me whether Windows XP Home (Not XP Professional) is supported under ant Cisco VPN client 4.xx or 5.xx. We have several "home" users and when trying to install it just causes the pc to do a looping reboot.

  • Yahoo/Apple mail CONSTANT server errors!

    I've had my iPhone now for a few months and at least one time a day I keep getting the following message when checking for new mail with Yahoo: "CANNOT GET MAIL...the connection to the server "imap.apple.mail.yahoo.com" failed. Usually if I try it a

  • Issue regarding Standrad report for IT0057

    Dear All, Is there a standard report for infotype 0057(member ship fees) Regards Nalla

  • Itunes sound issue after update

    After i updated itunes all my music files sound like this: http://www.roadbullettransport.com.au/itunes.wav Any idea's on how to fix this?

  • IDVD crashes unexpectedly when trying to burn a DVD.

    Hi. Although this question is previously asked by 'Marie' and successfully answered by 'Silly Rabbit', I and many other users experience the same problem of iDVD crashing when pressing the 'Burn' button, even after following the steps: 1. Remove iDVD