Choose the text file calling the Script DataMerge

I have to write a script that calls the script DateMerge, I find how the it (using: app.activeDocument.dateMergeProperties.mergeRecords ();).

But problem: the scipt call script DataMerge, but use it with the last text file that I use.

I would choose as a text file when I call the script DataMerge.

I hope you understood my question, I'm not a pro in English: S

Tank you for your help

It is in the same line. The location of the merger will in parentheses immediately following the mergeRecords() for example

app.activeDocument.dateMergeProperties.mergeRecords (FILELOCATIONGOESHERE);

It doesn't have to be a file written in full either location, it can be a variable that has been declared elsewhere for example

var csvFile = File.openDialog('select TXT file');
app.activeDocument.dateMergeProperties.mergeRecords(csvFile);

Colin

Tags: InDesign

Similar Questions

  • How to get the script to a table or view in SQL Developer?

    Dear friends/expert,

    Could you tell me how to get the script from a view or a table easily in SQL Developer as pressing F4 in TOAD?

    I found that I can press SHIFT + F4 to view in SQL Developer and get the script of the view in the Details tab. But how to move the script to the SQL worksheet to change? It is very easy to do in TOAD.

    And I have not found a way to get the script for a table up to now. Is it possible to do?

    Thanks in advance.

    Best regards
    Ning

    There are people a lot better out there to answer on this point than I am - but here's how I do it.

    I'm just in the browser/browser for interest table, choose the script on the right side tab (which shows all the SQL for the table) and then cut and paste what I want or need in my editor window.

  • I'm doing a script that takes a list of e-mail from a text file and then allow me to select a save as a string. I found some ways to get the path of the file, but I'm in check by pulling the list

    I found some ways to get the path of the file, but I am defeated by pulling the list from that. the function of the path get gives me the path as "Macintosh Users:: Documents: extractedb.txt (myUsername).

    What I can't understand is how to get a dialog box to display a list that represents the content in the text file, I need to change the contents of the text file, I need the box to show me what I chose and I want to save my selection as a single string.
    e '.

    example of extractedb.txt information:

    [email protected]

    [email protected]

    [email protected]

    * has a random number of emails as well *.

    I want this is to pull those emails from the text file and turn them into a list so I can get to be a selection in my dialog box.

    Any help would be great = D

    Assuming you have a text file with your example e-mail addresses, the following AppleScript will read this file in a list (mf_List) and then use this list as input to choose among the list. Because multiple selection is allowed (control button), the output is sent to a list (sel_addr). We check if the Cancel button was pressed by testing for false and if this condition is met, we the script error.  Based on a single or multiple list item content of the list, display accordingly.

    game of mf to ((path to the folder as text) & "mail_list.txt")

    the value mf_List to {}

    the value sel_addr to {}

    the value mf_List to paragraphs of (read file mf)

    the value sel_addr to (choose from the list mf_List with title ¬

    ('Mail list' with multiple selections allowed without empty selection allowed)

    If sel_addr is equal to false then

    Error number-128

    return

    end if

    If length of sel_addr is equal to 1 then

    sel_addr display dialog box as text

    on the other

    the value Point to the text of TID to AppleScript delimiters

    the value Point text in AppleScript return delimiters

    display the dialog box elements of sel_addr in the text

    the value Text of point AppleScript delimiters to TID

    end if

    return

  • Script to add description and keywords to the files of text file

    If anyone can write something for me? I must say I can't do it myself, I don't know Javascript.

    I need to add keywords and a description to 1000 pictures. I have a file of text formatted as such for each 100 images. The script will have to request an input file (or I cannot hardcode the path in the script) and apply to the folder being images in bridge.

    Example of a text file:

    1000 Bright Sunset Over City. (sun city sky; mountain;).

    1001 - Dawn Behind mountain and Lake. (Sun Mountain water; sky;).

    1002 - red sunset, sharp light of the bright clouds. (Sun sky tree; clouds;).

    1003 - tree framing Sunset Over the Bay. (tree; Sun Lake; Bay;).

    1004 - Sun Behind Seagull on stilts. (Seagull; Sun sea; stilts;).

    images are named 1000.tif, 1001.tif, 1002.tif etc.

    Running on a Mac with CS3 and CS4.

    Thank you

    Chris

    Thank you very much, David, I have to read more about these things, I modified the script you wrote.

  • The call of the dynamic text file javascript function

    This is probably a fairly easy problem, but it seems to be confusing me. I have a JavaScript function just opens a new window, wrote a little html and captures an image to place in the window. The javascript is on the page my .swf into flash. It looks like this:

    < script type = "text/JavaScript" >
    <!--
    function newWindowLand (picWinLand) {}
    bigpicWindowLand = window.open (", ' picWinLand ',' height = 500, width is 660, scrollbars = no, status = yes, resizable = no" ")
    bigpicWindowLand.document.write ("image window test < html > < head > < title > < /titre > < body bgcolor = #FFFFFF leftmargin = 0 topmargin = 0 marginWidth = 0 marginheight = 0 > < Center > < img src =" + picWinLand + "height = 480 width = 640 border = 0 > < / html >" "")
    bigpicWindowLand.document.close)
    bigpicWindowLand.focus)
    }
    ->
    < /script >

    I got this link in my html page:

    (< a href="javascript:;newWindowLand('static_images/news/test_image.jpg')" > link < /a > test "

    and it works very well. I then pasted this link in my dynamic text file that loads into my .swf, and nothing happens. I see the text "test" and it seems to be clickable, but if we click on it I get nothing. Am I missing something really obvious here? TIA...

    I got mine to work. The problem was the ":;" in my anchor tag original-just need to be a colon by itself. I got it in fact that at the beginning, but my test showed that it works because of the new security with Flash 8 gibberish. As soon as I downloaded everything and lived test everything has worked well...

  • ExtendToolscript opens when I call the script from photoshop

    Hey,.

    I asked this question on in general discussions by mistake if I though I would ask new here.

    I have a Javascript that I wrote which generates an interface of buttons in groups organized according to the contents of some folders. Everything works fine, but when you call it from photoshop and extendtoolscript it is not always executed it opens. I wrote many scripts with interfaces and I've never had this problem. This isn't a huge problem for me, as I usually have this program open anyway, but I intend to have a team of people using this script, so if I could stop, somehow, it would be much better.

    If anyone has experienced this before? Or maybe functions extendscript causes to open?

    I don't see anything unusual in the script...

    Any help would be appreciated!

    Thank you

    Mark

    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    
    
    
    
    var templatepath = "~/Desktop/BANNERS/";
    
    
    var bannerfile = ""
    var docRef = app.activeDocument;
    
    
    
    
    var fileArray = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "MAIN/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray.push(doc);
                                                    }
                                    }
                    }
                
                
                var w = new Window ("dialog", "Choose a Banner");
                w.preferredSize = [400, 100];
                w.orientation = 'row';
                w.alignChildren = "left"
                w.alignChildren = [ "fill", "fill"];
                
                w.btnPnl = w.add('panel', undefined, 'MAIN');
                
                w.btnPnl.btn = w.add ("group");
                w.btnPnl.btn.alignChildren = "left"
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArray.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArray[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                if (fileArray.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArray[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "MAIN/" + buttonname + '.png');
                    
                     }
                 }
             
     ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    var fileArrayneon = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "NEON/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArrayneon.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, 'NEON');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArrayneon.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArrayneon[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                
                if (fileArrayneon.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArrayneon[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "NEON/" + buttonname + '.png');
                    
                     }
                 } 
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
    var fileArray180 = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "180/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray180.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, '180');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArray180.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArray180[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                        
                   if (fileArray180.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    
                    
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArray180[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "180/" + buttonname + '.png');
                    
                     }
                 }   
      
    
    
    
     ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    
    var fileArraymisc = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "MISC/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArraymisc.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, 'MISC');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArraymisc.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArraymisc[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                    if (fileArraymisc.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArraymisc[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "MISC/" + buttonname + '.png');
                    
                     }
                 }  
    
    
    
    
    
       
                     
     w.show();
    
    
    
    
    
    
    
    
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
     if (bannerfile == ""){}
     else{
    
    var targetDocumentName =  docRef.name;
    var tempfile = app.open (bannerfile);
    var sourceDocumentName = app.activeDocument.name;
    
    
    
    
    var thewidth = tempfile.width;
    var theheight  = tempfile.height;
    
    
    
    
    app.activeDocument = docRef;
    docRef.resizeImage (null, theheight, null, ResampleMethod.BICUBIC);
    
    
    if ((String(thewidth)) == (String(docRef.width))){
    var thelayer = docRef.activeLayer;
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
    }
    else {
    alert ("Document width Incorrect")   
    
    
    docRef.activeLayer.name = "main";
    var thelayer = docRef.activeLayer;
    docRef.resizeCanvas (thewidth, null, AnchorPosition.BOTTOMCENTER);
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
     }
      imageView ("FtOn");
     }
    
    
    
    
    
    
    
    
    
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    
    
    
     function copyLayers(sourceDocumentName, targetDocumentName) {
      var sourceDoc = app.documents[sourceDocumentName];
      var targetDoc = app.documents[targetDocumentName];
      var sourceLayer, targetLayer, sourceGroup;
    
    
      if (app.activeDocument != sourceDoc) {
        app.activeDocument = sourceDoc;
      }
    
    
    var thelayer = tempfile.layers[0];
    var layersToCopy = thelayer.name;
    
    
      if ( typeof layersToCopy === 'string' ) {
        sourceGroup = tempfile.layers[0];
        targetLayer = sourceGroup.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING )
      }
      else if ( Object.prototype.toString.call( layersToCopy ) === '[object Array]' ) {
        for (var i = 0; i < layersToCopy.length; i++) {
          sourceLayer = sourceDoc.artLayers.getByName( layersToCopy[i] );
          targetLayer = sourceLayer.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING );
        }
      } 
    tempfile.close(SaveOptions.DONOTSAVECHANGES);
    }
    
    
    
    
    
    
    function imageView (view) {
        desc= new ActionDescriptor();
            ref = new ActionReference();
          if (view.length < 5){
             var viewID = charIDToTypeID( view );
          }else{
             var viewID = stringIDToTypeID( view );
          }
          ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), viewID );
        desc.putReference( charIDToTypeID( "null" ), ref );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    };
    
    

    $.writeln (written) the text specified in the JavaScript Console to ExtendScript Toolkit.

    You will probably need to 4 occurrences of the following line, apparently used for purposes of debugging in comment:

    $.writeln (e.target.text + " from panel " + e.target.parent.text);

  • management of the script errors when using the step of the call placed

    I have a script which is activated by a trigger of jtapi. At some point places the caller on hold, makes a call using step Place call, plays a prompt and then terminates the call.

    If the trigger (first contact) hangs up when the phone for the second contact rings, when the second contact answers the phone plays the default script or "Sorry we currently live the problems of the system."

    Here's what I did (without success) to try to get around it: changed the default script for the application (do not know why it does not work.) This logic is invoked in a subflow, maybe that's the problem?), placed a Terminate step for the second contact in case of square step call, put in a bunch of steps On Error Goto who attend a stage finish to the second contact.

    Brandon, until the original caller is replaced, an 'exception' will be thrown.

    To make up for it, to the step "On Exception GoTo" > choose the ContactInactiveException > choose the label you want the call to go into the script > clears the exception (on no exception) and then play your .wav file (sorry, the band hung up.. blah, blah) > and then terminate.

    who should git'r done.

    Pleae rate useful positions.

  • UCCX call in the script to disable all scripts in an emergency.

    I work with UCCX 8.5 and I need to develop a script that the end user can call tones allows to disable the call center and send it to a message.  This way if anyone is able to do via the VPN or close a connection, they can call.  I already have a basic script writes the only problem is written and pulling from a file so text or xml.  Basically, when the user calls, they will be in a menu which will be asked if 1. call centers are closed and 2. What is the reason for the closure. Expect this can be bettr

    Call answer

    Quick-press 1 if call centres are closed and press 2, what they are open

    1. write in a file "closed".

    Then go to the closed guests

    2. write in a file "open".

    Then go to the end

    Closed 1 guest-press for the closure of the weather, press 2, emergency closure, press 3 meets at closing

    1. write in the file 'weather_closure '.

    go to the end

    2. write in the file 'emergency '.

    etc, etc.

    The daily script would check this file first if it is closed and if yes, then invites to play.

    This is the file that I did so well. The script is easy.
    Aid.

    Hello

    No, you don't have to use an XML.

    The link I gave explains you how to use a simple text document.

    I suppose you create a file with this content:

    Open = 1

    Name it something like "open_or_closed.properties".

    Use this simple Java code to read the contents of the file. As prop.getProperty ("open"). Use an If not in UCCX script to check the value, if 1, then the call centre is open, if 0, closed.

    G.

  • How to connect the console to ExtendScript Toolkit prints to a text file

    Hi Chaps,

    I want to put prints in my entire Script and take the script logs.

    To do this, I need to connect the output of the entire console to a text file.


    Can someone tell me please how to write the console output to a log file?

    I would suggest placing the code of luda.dall in a function.  Then just call the function instead of $. writeln() to connect to the console and the file:

    function logMe (input)

    {

    var now = new Date();

    output var = now.toTimeString () + ":"+ entry;»

    $.writeln (output);

    var logFile = File("/path/to/logfile.txt");

    logFile.open ("e");

    logFile.writeln (output);

    logFile.close ();

    }

  • How the script create\edit\save\load file?

    I can't find a tool or a command to create the script file in the powercli environment.

    How to create or load the script file?

    It is the simplest form simply the PowerCLI prompt and a text editor such as notepad for example.

    Once you have your script in a .ps1 file, you can call/run the script from the prompt PowerCLI.

    PS C:\Scripts >./myscript.ps1

    You will have to ensure that the performance of PowerShell policy is set correctly to be able to run scripts.

    The is easier to develop and run scripts using a graphical interface that allows you to edit and run the script in the same graphical interface.

    With PowerShell comes the ISE, which became pretty good in PS v3.

    And there are other GUIs as more than Idera PowerShell and PowerGui.

    One to use is a matter of personal preference

  • Save the text file on the desktop

    Hello world

    See my code below. It saves the text file in the root folder. But I want to save my file of text of the report on the desktop in a folder called report.

    Secondly, when I run this script twice, he adds comments twice in the text of the report file and does not replace the text file report.

    Can someone please correct this JS script.

    function write (text) {}

    var myDocName = app.activeDocument.name;

    var myFilePath1 = + ' / ' + 'Report' + ".txt";

    var monFichierTexte = new queue (myFilePath1);

    If (myTextFile.exists)

    {

    myTextFile.open ("e");

    myTextFile.seek (0, 2);

    }

    else {}

    myTextFile.open ("w");

    }

    myTextFile.write (text + "\r");

    flag = true;

    myTextFile.close ();

    myTextFile.execute ();

    If (flag == false) {}

    Alert ("no error")

    }

    }

    Thank you

    You have contradicting wishes.

    Compare this sentence

    designmon79 wrote:

    I need a code JS that replace my office report text file (if the output) and write the cool comment text in the file.

    with this

    It replaces the report file, but also delete text in the file.

    It seems obvious that if you replace the previous file, the old content will be deleted.

  • Help to import the data from the catalog to a text file (csv import, delimited by tabs, excel)

    Hi All-

    I was hitting my head on this one for a few days now. It seems that something that has probably been done before and should not be so difficult, but I found few cases of help in the documentation from Adobe (and researched a lot of google).

    I have a catalog of retail sale of 100 pages with approximately 1000 products in InDesign CS5. I have a spreadsheet excel with the names of products this year, prices and descriptions of update. Normally, we would go through one by one and cut and paste. This year, I thought I would try to skip this step. There are plugins that do this, but they are not cheap, and we are not big. Upgrade to CS5 of CS2 is a big investment in and of itself.

    ssp_temp_capture.jpg

    Here is an example of the data (I use a vertical bar as a separator character):

    28392779 | 3627 | Super top | Get a handle on the pleasure. Wrap the cord around the axis and s '. | 6½ "long
    | $10

    Then... standard excel file exported to a delimited format (I use OpenOffice to export in order to avoid the problem of excel citing darn close * everything *). In the InDesign file, we have a component of text for grouped each name, description, and price. The Group has a title of the product ID script and each field within the group is labelled accordingly (name, id, description). Thus, the Group: 3627, point: description (name or price).

    Pseudocode:

    Open the file

    Analyze the data in a table

    Scroll through the InDesign file group

    Check the script group label, look it up in the table, assign values to the fields

    Easy right?

    I'm not new to javascript, but it is not my tongue harder. With this effort, I had problems as simple as the syntax for the identification of the groups by their label. Anyway, here is the code (it is not pretty as the only way that I could not even run to scroll the table of data line by line and then scroll the entire InDesign file for each row of data. And, Yes, it takes about an hour to run--but it * is * run):

    myDocument var = app.activeDocument;

    data var file = File("/Users/reddfoxx/Desktop/2010Sept8CatDesc.csv");
    DataFile.Open ("r");

    data var = datafile.read)

    data = data.split("\n");


    the data array is indexed from 0
    field 0 is the internal ID
    field 1 is the product ID
    field 2 is the name of the product
    zone 3 is the description
    field 4 are the dimensions
    zone 5 is the price

    for (x = 0; x < data.length; x ++) {}

    data [x] = data [x].split("|");


    for (var z = 0; z < myDocument.groups.count (); z ++) {}
    {If (myDocument.groups.item (z) .label == {data [x] [1])}
    myGroup = myDocument.groups.item (z);

    for (var y = 0; y < myGroup.textFrames.count (); y ++) {}
    If (myGroup.textFrames.item .label (y) == "name")
    {
    myGroup.textFrames.item (y) .silence = data [x] [2];

    }



    If (myGroup.textFrames.item (y) .label = 'description')
    {
    myGroup.textFrames.item (y) .silence = data [x] [3];
    }

    If (myGroup.textFrames.item .label (y) == 'dimensions')
    {
    myGroup.textFrames.item (y) .silence = data [x] [4];
    }

    If (myGroup.textFrames.item (y) .label = 'price')
    {
    myGroup.textFrames.item (y) .silence = data [x] [5];
    }


    }
    }
    }
    }

    For someone who is not familiar with the groups and scripts, unfortunately, you cannot process blocks of text within a group without using the group. At least, that's what I understand.

    Any help would be appreciated. Even just to find how to approach a particular in the document, so that I don't have to scroll through the entire file and do a comparison for each element would be a big improvement.

    Thanks in advance.

    -Redd

    Hey!

    You have nice little problem here

    Well, unfortunately, InDesign CS5 is a bit heavy on the labels of script, there were some changes and other things. In CS4 and before, when you call pageItem.item (myItemName), you would get called from script, but in CS5, it has been changed, and now you get the element name that is in the layers palette. Now you can easily copy all the script tags, new place, and then it would be easy to access items by name of the element.

    This will copy all the labels current script name of the element:

    for(var i = 0; i < app.activeDocument.allPageItems.length; i++)
      app.activeDocument.allPageItems[i].name = app.activeDocument.allPageItems[i].label;
    

    Now, when you have all the names in place, you can access them like this:

    app.activeDocument.groups.item(data[x][1]).textFrames.item("name").contents = data[x][2];
    app.activeDocument.groups.item(data[x][1]).textFrames.item("description").contents = data[x][3];
    app.activeDocument.groups.item(data[x][1]).textFrames.item("dimensions").contents = data[x][4];
    app.activeDocument.groups.item(data[x][1]).textFrames.item("price").contents = data[x][5];
    

    I hope that helps!

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • count down the days of text file

    Hi all. I use this script

    Code:

    this.createEmptyMovieClip ("loader_mc", 0);
    loadVariables ("assets/flash/splash/deadlines2.txt", loader_mc);
    Declaring variables
    year;
    months;
    day;
    DESC;
    Check if the variable text file are loaded
    function varLoaded() {}
    If (loader_mc.y! = undefined) {}
    year = loader_mc.y;
    month = loader_mc.m;
    day = loader_mc.d;
    DESC = loader_mc.desc;
    clearInterval (interval);
    }
    Then call the function to calculate the difference in days
    diffDays();
    }
    var interval = setInterval (varLoaded, 100);
    //
    function diffDays() {}
    End_date var = new Date (year, month, day);
    var tmp_date = new Date();
    var now_date = new Date (tmp_date.getFullYear (), tmp_date.getMonth (), tmp_date.getDate ());
    var difference = end_date.getTime () - now_date.getTime ();
    var daysleft = difference/1000/60/60/24;
    desc2. AutoSize = 'left ';
    desc2.htmlText =! daysleft? "< b > > today ':" < b > > "+ daysleft + (daysleft > 1?". ("Days < /b > ':"< /b > Day") + desc;
    desc2.setTextFormat (new TextFormat ("Verdana", 9));
    }

    It is quite crumbly, sometimes it works sometimes I get weird results.

    If I put this:

    y = 2007 & m = 2 & d = 23 & desc = date deadline - March 23, 2007


    in the txt file, I 23.9583333333333 days. 23 is not even right. In addition, I do not need these decimals. Any direction would be great.

    Thank you
    Mike

    Thanks much for the advice. I used math.round and it worked very well. I changed:

    var daysleft = difference/1000/60/60/24;

    TO

    var daysleft = Math.round(difference/1000/60/60/24);

    Thank you
    Mike

  • Is there a way to open the text files with arbitrary extensions?

    As part of the mobile platform iOS, is possible to open arbitrary text files that have an arbitrary extension?  For example, in the course of my work day, I meet regularly with plain text files that have an .out extension.  I'd love to be able to open these simply with iOS notes without renaming them in .txt.  I meet many of them and only need to do this for a few minutes, so take the time to rename them significantly adds both.

    On the desktop a BONE can generally "open with", then choose the application.   I'm looking for the equivalent in iOS.  Please note that to access the files on iOS is not a problem with icloud drive, dropbox, etc..  they just can not be opened easily.   Simple text editor, word processor not full blown.

    You will need a software that can handle the file.

    Usually the file management applications can manage any type of file.  I like the 5 Documents to Readdle, it can open almost anything.

    https://iTunes.Apple.com/us/app/documents-5-file-system-PDF/id364901807?Mt=8

    The equivalent of 'Open with' in the iOS is "open in", 'Share xxx' or even 'Copy To '.

    How to get to it, depends on where the file is located.

    ICloud drive for example, you can do open the file in a specific application by holding your finger on the icon of the file and by selecting more «...» "in the menu that appears, and then selecting"Share point... ". "and finally select an application from the list.

  • Is there an easy way to copy the content of each message into a folder in a text file (without visiting each email, select, copy paste)?

    I need to scratch the data of a few 1000 + email. How can I believe more easily the content of these emails and either push in text files, or treat them with a script?

    Thank you

    Install ImportExportTools:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/ImportExportTools/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

    Copy the messages in a folder, select the folder, tools/ImportExportTools/export all of the messages in the text file / in the single folder.

Maybe you are looking for

  • What is the 4th gen Siri of AppleTV talk?

    Does anyone know if Siri on the 4th gen AppleTV is expressed out loud? Currently I have on-screen displays of responses of Siri. If Siri can speak aloud, I couldn't see the setting for this.

  • Support for LabVIEW 2014 and CanOPEN cRIO-9067

    Hello We have NEITHER 9881 CANOpen communication module and cRIO-9067. According to the NI 9881 product description page the module should work with cRIO-9067. However, does not support the latest NOR-Industrial Communications for CANopen 1.0.3 2014

  • HP 15-n096sa hard drive enclosure

    I have recently buy a hp from ebay and they send me winout hard drive. I buy a hard drive, but the problem is that I don't have a shopping cart. Where can I find a shopping cart of 15-n096sa Hp

  • Cannot get the cd/dvd driver for CD playback

    Hiya Earlier this year, my laptop has been infected by viruses, malware, etc. I used the program Spyware Doctor to remove any infections, but so many files and programs are removed. On the Device Manager CD-ROM/DVD-ROM driver TSSTcorp DVD +-RW TS - L

  • HP P1102w and Mac OS Yosemite LaserJect

    Get various error messages when you try to print to P1102W, both on direct USB as well as the wireless on a MacOS 10.10.5 MBP.   Errors include "filter has failed" and also "Server stopped.  All software are up to date on the side of Mac OS.   Any id