ExtendScript script to target InDesign CC

I have a javascript that worked in InDesign CS6, but will not work in ID CC. First of all because I need it to target the new InDesign CC correctly.
I change the line #target Indesign-8.0  to #target Indesign-9.0, but that will not work. I get a message that says "Indesign-9.0" is undefined.
How do I properly get the script to properly call up the correct InDesign?    

Further discussion of this here:
http://forums.adobe.com/message/5946718#5946718

Similar Messages

  • Targeting Acrobat from a script begun in InDesign

    My goal:
    Export a pdf, have the pdf open in Acrobat and run a preflight setting.
    I can get the pdf to open but InDesign is still the active application. What is the code to target Acrobat.
    I've tried:
    #target "Acrobat"
    because I found #target "InDesign" would target the latest InDesign version.
    Bonus points: Help with selecting the preflight setting would be helpful too.
    Thanks in advance.
    John

    Hi 2i Geert and thanks for the idea.
    I have made it with:
    reply = "";
    conn = new Socket();
    if (conn.open("192.168.91.184:8888)) { // my port and host
    conn.write(" GET /myfile.php?" + variousVariable + " HTTP/1.0\n\n");
    reply = conn.read(999999);
    conn.close;
    With this code, the myfile.php seems to been executed.
    But I'm still searching for a better solution.

  • Target InDesign version

    Hi All,
    I am having Indesign CS5 and CS6 in my machine, i want to run JS in CS5, how do i target the version 
    can any one help me on this...
    my code:
    #target indesign;
    Thanks,
    David

    @David – See page 235 of "Java Script Tools Guide CS5.pdf" for details on #target and details on "namespace" for the individual application see page 191 ("Application and namespace specifiers"):
    http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/indesign/pdfs/JavaS criptToolsGuide_CS5.pdf
    So:
    #target indesign-7.0
    should target CS5
    #target indesign-7.5
    should target CS5.5
    #target indesign-8.0
    should target CS6
    However I had no luck with an added locale to the version name out of the ESTK:
    #target indesign-7.5-de_de
    //Some alert:
    alert(app.version);
    should address a German InDesign CS6 but yielded an error:
    "indesign-7.5-de_de is undefined"
    The following would work, but I cannot test against a second (e.g. international) version installed:
    #target indesign-7.5 de_de
    //Some alert:
    alert(app.version);
    However, if you double click on a script in the Scripts Panel and you are using no #target direction the targetted app should automatically be the app where the Scripts Panel belongs to.
    Uwe

  • I have two script. one for indesign and another for photoshop. how can i merge both scripts?

    hi all,
    i have one script for indd which convert a user selected table as JPG (1276 px width, height varies). Second photoshop script which ask user to select jpg file and then check if pixel height is less than 1018 pixel, then it enlarge canvas size(height) to 1018 px.
    how can i combine both script, any tip or how to start would be helpful? The workflow should be:
    user select the table in indd document
    table export as jpg
    script will ask to select table jpg file or if it can be automated too that would be good.
    enlarge canvas height to 1018 px
    thanks
    virender
    PS: i already read the Java scirpt tool guide pdf but unable to understood

    Hi,
    I see two possible approaches here. The most logical would be to use a BridgeTalk Object that let you execute another app js code inside yoru primary app. In your case, you start your script from within InDesign and at some point the Photoshop specific script is executed thanks to the BridgeTalk Object.
    Other option is to use either AppleScrip or VB to execute the codes while targeting the specific app.
    Eventually, you may have your PS code in some external file and call $.evalFile when of course the file has a target instuction as Peter exposed.
    Once again, I think what you need is BridgeTalk.
    FWIW,
    Loic
    http://www.ozalto.com

  • How to place tif file through a script in an indesign document?

    how to place tif file through a script in an indesign document?

    Emanuele:
    it works if i just run a script....
    but since i have been using a gui to do some functions, this  place command is not able to place the output tif file back into the  document

  • How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document

    How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document uses multiple pages sizes and won't print.  My page sizes are all 10" x 10"

    Please post in the InDesign forums here http://forums.adobe.com/community/indesign/indesign_general. They will be able to help you.

  • Calling an ExtendScript script from the command line

    Hi! I can call an ExtendScript script from a command line just by using its path, but is there a way to pass parameters to the script? Thanks. -Rick

    Hi Rick,
    Well, a scan of the documentation certainly provides no evidence of this capability. If it exists, someone else will have to fill us in.
    I did have an idea, although it's a bit of a roundabout approach. A windows batch file can accept parameters and can write a text file. So, maybe Mif2Go can call a batch file instead that writes the folder to some file, then runs the script that reads the file. Although, I'm not familiar with a command line call to ES, so I'm not sure that a batch file can launch an ES script too. If not, can Mif2Go make more than one command line call?
    Russ

  • Is it possible to store script settings with InDesign file?

    Hi,
    I have some crazy idea: is it possible to store script settings with InDesign file?
    In that case scripters will be able to store those settings with file, and when script runs - it can check if those setting exists - if so - script can run without showing dialogue with parameters... (as all necessary parameters stored with indesign file), and of course we can force InDesign to show script parameters dialogue if we run it with alt/option key pressed while running this script. Maybe even different scripts will be able to share those settings and interact with each other.. we will be able to have settings that will be saved with file, or temp settings for current document or session (till InDesign is closed). With eventListeners and startup scripts we will be able to do scripts that would be able to check for updates, and automatically execute when we placing images and text, and so on.. this can be a whole InDesign scripting framework, that allow to write scripts that will use same libraries and ui so we don't have to write everything from scratch everytime and just included required libs..
    so here is 2 main questions for now:
    1) is it possible to store script settings with .indd file
    2) who is intrested in creation InDesign scripting framework (because this only makes sense if many people will use it)
    PS: I know that it's possible to store settings in external file, but this time I'm interested only for saving params with .indd

    Ok, here is the labels parser I end with, actually it works extremely fast!
    Thanks again, Harbs!
    var labels = GetDocLabels(app.documents[0]);
    function GetDocLabels(doc)
        var idmlFile = File(Folder.temp + "/temp.idml"); 
        doc.exportFile(ExportFormat.INDESIGN_MARKUP,idmlFile); // asynchronousExportFile works, but script fails as it try to execute before file fully exported
        var folder = Folder(Folder.temp + "/temp_idml"); 
        app.unpackageUCF(idmlFile,folder); 
        var designMap = File(folder + "/designmap.xml"); 
        var valuePairs = GetValuePairs(designMap); 
        return valuePairs;    
    function GetValuePairs(file)
        file.open("r");  
        var contents = file.read();  
        file.close();   
        var contXML = XML(contents);
        var vals = {};
        for each(var pair in contXML..KeyValuePair)
            vals[[email protected]()] = [email protected]();       
        return vals;  
    //> START of DELETE FOLDER Function
    function deleteFolder(path)
        removeFolder = path; // path to folder that need to be removed
        filesToRemove = removeFolder.getFiles();
        for(i = 0; i < filesToRemove.length; i++)
            try
                innerFolders = filesToRemove[i].getFiles();
                if(innerFolders.length >= 1)
                    for(f = 0; f < innerFolders.length; f++)
                        innerFolders[f].remove()
            catch(e){}
            filesToRemove[i].remove(); // remove temp files once we done
        removeFolder.remove();
    }//< END of DELETE FOLDER function
    // remove temp files once we done
    deleteFolder(Folder(Folder.temp + "/temp_idml"));
    File(Folder.temp + "/temp.idml").remove();
    // DUMPER FUNCTIONS
    function dump(o)
        out = "";
        for (var p in o)
            out += p + ": " + o[p] + "\n";
        return(out);
    function alert_scroll (title, input)
       if (input instanceof Array)
           input = input.join ("\r");
       var w = new Window ("dialog", title);
       var list = w.add ("edittext", undefined, input, {multiline: true, scrolling: true});
       list.maximumSize.height = w.maximumSize.height-100;
       list.minimumSize.width = 550;
       w.add ("button", undefined, "Close", {name: "ok"});
       w.show ();
    alert_scroll ("Document Labels", dump(labels)); exit();

  • Scripting label in InDesign CS5 vs CS4

    I have read through a few (several) of the posts and am not finding info that I understand to help me with this specific problem.
    I am editing a script that was written by another person several years ago and struggling to get it to work with InDesign CS5. The error I get seems to point to this bit of code that I believe creates a list from "labeled" text boxes in my documents. These boxes are later targeted and the content of them is changed based on the user's selection. As I understand it, the method or referring to these labels has changed in CS5, but the examples I have seen are all javascript or something other than Applee Script as far as I could tell.
    --create references to Pass check boxes
    try
        set passTextFrames to every text frame of all page items whose label is "Pass Text Frame"
    on error
        display dialog "There is no labeled box in this document. Please click on the Cancel button, then place a slug from the slug library and re-run the script." buttons {"Cancel"} default button 1
    end try
    Later the code used to change the content of these frames is:
    repeat with aPassFrame in passTextFrames
    set contents of paragraph 1 of aPassFrame to "SECOND PASS"
    end repeat
    Thanks for any help you can offer!

    tell application "Adobe InDesign CS5"
              tell the active document
                        try
                                  set passTextFrames to every text frame whose label is "Pass Text Frame"
                        on error
                                  display dialog "There is no labeled box in this document. ¬
                                  Please click on the Cancel button, then place a slug from the slug library ¬
                                  and re-run the script." buttons {"Cancel"} default button 1
                        end try
              end tell
    end tell

  • Script exe for indesign cs2 is possible?

         i wrote a javascript for indesign cs2 application, user move that to script folder and run it.
    sometimes they edit the script for their own, it makes some problem.
    is it possible to make the script in exe format.
    by using Extend toolkit2 if i make it as binary format indesign cs3 accepts it, but the script not view in cs2 palette...
    how to solve it?
    thanks
    subha

    the scripts for Indesign can be exported as a binary format using the ExtendScript toolKit..
    This might prevent users from modifying them.
    However this jsxbin format can only be used in CS3 and CS4.
    Mayb u may consider upgrading to CS3 / CS4..
    hope this helps..

  • Need script to export Indesign to word and keep word index codes

    Hi,
    I have a document and the index was created by importing word docs with indexentries. Now the client wants to revise the book and wants the text converted back to Word, but he wants to keep the orginal word index codes. Is that possible? Exporting as tagged text results in showing the index codes, but also much other codes which are not needed.
    Would be greatfuull for some tips, or preferable a script that does the trick.
    kind regards
    Peter
    Indesign  cs5.5 Imac 27 inch. Max osx 10.7.4 language Dutch

    designer1955 wrote:
    Exporting as tagged text results in showing the index codes, but also much other codes which are not needed.
    What were you going to do with this Tagged Text file? That's only good for re-importing it back into InDesign.
    Anyway, it doesn't require a script at all. I had the clever idea of testing this, and indeed: index entries in InDesign are exported in RTF.

  • Hyperlink target Indesign CC Interactive PDF

    Hi,
    We're working on an Interactive PDF but strangely enough we suddenly can't work with hyperlink targets anymore. This means we can't make certain objects a hyperlink target so we can't navigate
    through the document as we were used to. Any idea of how this is possible and what we can do about it?
    Kind regards,
    David

    I usually start by creating my Hyperlink Destinations by choosing New Hyperlink Destination from the Hyperlinks panel menu.
    Then I create my hyperlink. In this case I started with a text frame:
    I chose to link to a Shared Destination (although you don't have to):
    You can test this in InDesign when the Hyperlink is selected:
    When you test it in your PDF, be sure choose File > Export > Adobe PDF (Interactive) so the hyperlinks will be properly exported.

  • Is enabling VI Scripting in Target properties without any functionality?

    In the properties of the target "My Computer" (in a LabVIEW Project), I can enable and disable VI Scripting. But I do not see any effect of this setting. Only the global settings (Options) do have an effect. Can anybody confirm this?
    Some Details:
    I'm using LabVIEW 2013.
    I tried with Scripting enabled in the global options and disabled in the project properties and the other way around. I opened and closed the projects and restarted LabVIEW.
    A description of the effect of this setting is in the LabVIEW help.
    The property of the target is in the category "VI Server", the box "Show VI Scripting functions, properties and methods" (see image below).

    Hi,
    the global settings enable VI Scripting for your entire project. After that, you enable VI Scripting for your desired target systems, which is "My Computer" in your case.
    But you're right - I tried it and the settings in the "My Computer" properties had no effect, only the global settings. I will try to get further information on this behaviour, maybe there's something we missed or it's a bug...
    Regards,
      Michael
    Certified LabVIEW Associate Developer

  • How do we update the script from Adobe Indesign CS2 to CS3?

    hi,
    What is the main difference between the adobe indsign cs2 and indesign cs3?
    How do we update the script acccording to the version?
    Regards,
    Subha

    Which script? Did you look at this topic:
    http://adobeforums.com/webx/.3bc3cc98/60?14@@
    Dave

  • Using a script on an indesign server

    I am new to working on an InDesign Server. I have built a template that requires a javascript for alignment issues. What needs to be done so the script is accessed when the file is accessed via the server?

    Please see this link,
    http://cisco.com/en/US/tech/tk583/tk372/technologies_configuration_example09186a00800949ba.shtml
    Regards,
    ~JG
    Do rate helpful posts

Maybe you are looking for