A trigger performs an InDesign javascript at regular intervals...

I have a javascript that runs in Adobe InDesign CS3 for Windows at regular intervals, say every five minutes. The purpose of the script is to test the latency of our production servers time - he opens a test document, an image of the scene, formats a text, closes and saves the document. At the end of the routine, he wrote the elapsed time for this process in a log file that is monitored. This allows us to monitor the status of the network and IO on the servers because all docs test are open on our network from a workstation user. The script itself works fine, but I'm looking for a way to trigger at a given time interval. I be interested to hear any ideas group has on how this can be done. Thanks in advance, Will

In CS5, you can use idleTask to run the script using ExtendScript.

Here's a tip on a way forward on this issue in AppleScript:

http://forums.MacRumors.com/showthread.php?t=586719

Substances

Tags: InDesign

Similar Questions

  • Create the Excel using Indesign javascript file

    Hi all

    We can create csv file using indesign javascript. Is there a way to create excel file using indesign javascript?

    Thanks in advance

    Hi all

    It is a way to generate an Excel from an InDesign table by using a combination of jsx, vbs and applescript.

    Quite a long discussion on that Open with below is a better application of the suggestions here.

    // Exports SIMPLE tables to proper excel file single and double quotes in the table would have to be escaped on the Mac version
    // Does not take Unicode file names
    // with a bit of brain racking can be developed to deal with merged cells and nested tables
    // Pieced together by Trevor (wwww.creative-scripts.com coming soonish) based on the referenced sources
    // Sold AS IS https://forums.adobe.com/thread/1718021
    
    var doc = app.properties.activeDocument && app.activeDocument,
           myTable = myTable || getTable (doc);
    if (!myTable) {alert ("Take a break, needs a document with a table in it!"); exit();};
    var filePath = new File (Folder.temp + "/" + +new Date + ".xlsx"),
        osFilePath = filePath.fsName;
    if ($.os[0] === "M")  osFilePath =  osFilePath.replace(/(.)(\/)/g,"$1:").replace(/\//, "");
    
    exportTable (myTable, osFilePath);
    if (confirm ("Open new excel file")) filePath.execute(false);
     exit()
    function exportTable (myTable, filePath)
        {
            var  numberOfRows = myTable.rows.length,
                   rowNumber, columnNumber,
                   isMac = $.os[0] === "M",
                   rowContents = [],
                   setRange, openMark, closeMark;
    
            if (isMac)
                {
                    setRange = 'set value of range "A';
                    openMark = '" to {';
                    closeMark = '}';
                }
            else
                {
                    setRange = 'app.Range("A';
                    openMark = '") = Array(';
                    closeMark = ')';
                }
    
    for (var z = 0, rowNumber = 0; rowNumber < numberOfRows; rowNumber++) {
        var  numberOfColumns = myTable.rows[rowNumber].columns.length,
                toRange = GetExcelColumnName (numberOfColumns - 1),
                columnContents = [];
         for (columnNumber = 0; columnNumber < numberOfColumns; columnNumber++) {
             var cellContents = myTable.rows[rowNumber].cells.everyItem().contents;
             columnContents  = '"' + cellContents.join('", "') + '"';
         }
        rowContents[rowNumber] = setRange + ++z  + ":"  + toRange+ z + openMark  + columnContents + closeMark;
    }
    
    var tableData = rowContents.join("\n") + "\n";
    
                   if (isMac)
                        {
                            // Thanks Hans https://forums.adobe.com/message/5607799#5607799
                           var myAppleScript =
                            '''set excelRunning to isRunning("Microsoft Excel")
                               tell application "Microsoft Excel"
                               set theWorkbook to make new workbook
                               tell sheet (1) of theWorkbook'''
                               + tableData + '''
                               end tell
                               save workbook as theWorkbook filename "''' + filePath + '''"
                               close active workbook
                               if not excelRunning then tell application "Microsoft Excel" to quit
                               end tell
                               on isRunning(appName)
                                    tell application "System Events" to (name of processes) contains appName
                               end isRunning
                            ''';
                          app.doScript (myAppleScript, ScriptLanguage.APPLESCRIPT_LANGUAGE);
                        }
    
                    else
                        {
                            // Thanks Calos https://forums.adobe.com/message/5607799#5607799
                            // changed by me :-)
                             var vbscript =
                             '''Dim app
                                Set app = CreateObject("Excel.Application")
                                'take away the ' from the line below if you want to see excel do it's stuff
                                'app.visible = true
                                Dim newDoc, sheet
                                Set newDoc = app.Workbooks.Add()
                                Set sheet = newDoc.Worksheets(1)
                                '''
                                + tableData
                                + 'newDoc.SaveAs "' + filePath + '''"
                                app.Quit
                                Set newDoc = nothing
                                Set app = nothing
                              ''';
                            app.doScript (vbscript, ScriptLanguage.VISUAL_BASIC);
                        }
    
                }
    
    function GetExcelColumnName (columnNumber) {// 0 is A 25 is Z 26 is AA etc.
        // parsed from http://stackoverflow.com/questions/181596/how-to-convert-a-column-number-eg-127-into-an-excel-column-eg-aa
         var dividend = columnNumber + 1,
                columnName = "",
                modulo;
    
        while (dividend > 0)  {
            modulo = (dividend - 1) % 26;
            columnName = String.fromCharCode (65 + modulo) + columnName;
            dividend = Math.floor((dividend - modulo) / 26);
        }
        return columnName;
    }
    
    function getTable (doc) { // thanks Marc http://forums.adobe.com/message/6087322#6087322
        if (!doc) return false;
        app.findTextPreferences = null;
        app.findTextPreferences.findWhat = "\x16";
        var tables = doc.findText();
        if (tables.length) return tables[0].parentStory.tables[0];
        return false;
    };
    
  • InDesign Javascript *.pdf in counter

    Hi all

    I want to ask you if there is a way to count the pdf files in the directory via Indesign Javascript. Thanks for the tips.

    GetFiles allows you to gather all your PDF documents (with "*.") PDF' as argument). Then check how long the resulting table is.

  • Can I run a service at regular intervals with the Windows Task Scheduler?

    Hai...

    I want to run a service on a regular basis. I was thinking about tasks windows schedular system. I want to know if it is possible to define the intervals of time explicitly windows Task Scheduler. I also want to know if we can choose a custom event if selected the option "when an event is logged. Your help will be very appreciated. Thanks in advance

    Hi SreedeviB,

    You can run a service at regular intervals with the Windows Task Scheduler.

    For more information, you can consult the following articles:

    Windows Vista Task Scheduler

    Schedule a task

    Automate tasks with Task Scheduler

    Hope this information is useful.

  • HTTP request at regular intervals

    Hello

    I have an application that update its database, create an http request and parsing the xml response (it dynamically build the query with xml content). I want to update my database at regular intervals, so I need to do http request at regular intervals, of power to the top of the device to power off. My autorun app at startup, but I would like to request http in the same interval, even if I enter the application and I close. I tried with the task of thread or a timer, but I have the same problem, it is if I enter the application and close the thread dies and I can't see http request. I don't know if I explain my problem... Can you tell me if there is a solution?

    Thanks in advance.

    Kind regards

    Gianni.

    Use a background application. You can use a different entry point (see the knowledge base) to enter your main application.

    a timer and timertask run a thread would be the best solution I think

  • copy data from a remote database at regular intervals

    I have this remote database A and B. DB database has 10 views and B DB has 10 tables. I must get out data in a DB A view and load into tables in DB B on a regular basis. How to make this work?

    Thank you

    You can write a procedure that inserts into the tables in database b. and create a task that executes this procedure at regular intervals.

    See this

    http://www.oradev.com/dbms_scheduler.jsp

    G.

  • Do not click the buttons to perform actions (InDesign)

    Hello

    I tried to do the following:

    • Click on and use the Selection tool or direct selection
    • Create/edit character and paragraph styles
    • Select the option to center alignment when the text is highlighted

    Whenever I click on these buttons, or even something similar, I get no response. I can confirm that my machine freezes up, isn't slow or delay.

    The other buttons below the selection and direct Selection tool can be clicked very well.

    Can anyone help?

    Maybe it's: https://helpx.adobe.com/indesign/kb/indesign-tools-panels-don ' t - respond.html

  • InDesign Javascript

    I want to learn javascript please any sample

    Hello

    1: Note This section of the site:

    "Recommended content".


    2nd: use Google and Acrobat Reader

    Jarek

  • HTTP GET with authentication does not work in Adobe Indesign javascript

    Hello

    This is the code I am trying to run in the Indesign script. The URL http://localhost:4502/content/geometrixx/en/company/news/articles.html works directly in a browser, it renders the content. But when I try running the below in Indesign, it gives the following result. It does not really give the conent return.

    InDesign script code:

    response = "";

    Conn = new Socket;

    access the Adobe homepage

    If (conn.open ("localhost:4502")) {}

    var request = "GET /content/geometrixx/en/company/news/articles.html HTTP/1.0\n\n ' +.

    "Authorization: basic admin:admin\n"

    Conn.Write (request); and read the response from the server

    response = conn.read (999999);

    Alert (Reply);

    Conn.Close ();

    }

    Output in Indesign:

    HTTP/1.1 404 not found

    Connection: close

    Server: Day-Servlet-Engine/4.1.12

    Content-Type: text/html; Charset = UTF-8

    Content-Length: 387

    Date: Wednesday, December 7, 2011 03:05:26 GMT

    <! DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 / / BY" > ".

    < html > < head >

    < title > 404 not found < /title >

    < / head > < body >

    Found < H1 > < / h1 >

    < p > the requested URL /content/geometrixx/en/company/news/articles.html was not found on this server. < /p >

    < hr >

    < address > ApacheSling/2.2 (Java hotspot Server VM 64 1.6.0_29;) Mac OS X 10.7.2 x86_64) < / address >

    < body / > < / html >

    Hello

    Your code has problems.

    1 HTTP request closed 1st line. Server wait and get the data so that come from "\n\n".

    2. name and password of the user authorization string must be base64 encoding.

    You can read as a reference:

    http://en.Wikipedia.org/wiki/Basic_access_authentication

    Here's an example query:

    var request = "GET /autharea/index.html HTTP/1.1\n '.

    + "Host: (servername) \n".

    + "Content-Type: text/html;" Charset = UTF - 8\n ".

    + "Authorization: basic" + encodedData + "\n\n";

    and work with function base64 code

    var authStr = "name";

    var encodedData = base64 (authStr);

    var response = "";

    var conn = new Socket;

    var request = "GET /autharea/index.html HTTP/1.1\n '.

    + "Host: (serverName) \n"

    + "Content-Type: text/html;" Charset = UTF - 8\n ".

    + "Authorization: basic" + encodedData + "\n\n";

    If (conn.open ('130.1.6.46:80', 'UTF-8')) {}

    Conn.Write (request);

    response = conn.read (999999);

    Conn.Close ();

    Alert (Reply);

    }

    function base64 (binaryString) {}

    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 + / =";

    var encoded = "";

    var c1, c2, c3;

    var e1, e2, e3, e4;

    var i = 0;

    While (i< binarystring.length)="">

    C1 = binaryString.charCodeAt(i++);

    C2 is equal to binaryString.charCodeAt(i++);

    C3 = binaryString.charCodeAt(i++);

    E1 = c1 > 2;

    e2 = ((c1 & 3) < 4)="" |="" (c2="">> 4);

    E3 = ((c2 & 15) < 2)="" |="" (c3=""> > 6);

    E4 = c3 & 63;

    If (isNaN (c2)) {}

    E3 = e4 = 64;

    } Else if (isNaN (c3)) {}

    E4 = 64;

    }

    encoded = code + keyStr.charAt (e1) + keyStr.charAt (e2) +.

    keyStr.charAt (e3) + keyStr.charAt (e4);

    }

    return encoded;

    }

    Ten

  • perform a function javascript on a linked page

    I have a page (one.html) which has a javascript function named rocker. on the page, it passes a variable to the function using onClick. for example, onClick = "toggle('img7').

    now on a separate page (two.html), I have link to this first page. I would like to have the link open this page and run the function of rocker, with a variable I specified in the link. is this possible? If so, how? "something to the effect of < a href =".. One.html & toggle ('img5'); "> my < /a > link

    Thanks a lot for taking the time!

    What I meant is that every page using this method must have
    the toggle() function to fade in, or who are related to him... as well as the
    the function below... two of them. The two functions could be placed in a
    external js file and liinked to all pages that use that.

    > In each page using your method...
    >
    > function runToggle() {}
    > loc = location.toString () var.split("?");
    > if(loc[1]) {}
    > var imgID = loc [1];
    > toggle (imgID).
    >} else {return}
    > }
    >
    > Add this to the body...
    >
    >
    >
    > Here are links...
    > Page 1
    > Page 2
    >
    >
    > --
    > Best regards,
    > .. Trent Pastrana
    > www.fourlevel.com
    >
    >
    >
    >
    > "NickTheNameless" wrote in message
    > news:[email protected]...
    > Thank you very much for your time. This is the rocking function...
    >>
    > function toggle (imgID) {}
    > / / This function allows to alternate the display of a text block status and who
    > of
    > Hide/show two images displayed
    > //the images need ID as follows: for section1, ID = img1, for
    > section2d3, ID = img2d3
    >>
    > model var = / img (\w+) /; var result = pattern.exec (imgID). result
    > must be a table, with the figures in the result [1]
    >>
    > If (result == null) {return ;} / / doing nothing if imgID is wrong}
    > format
    > var = 'section' well + result [1]; Well will be
    > section1,.
    > section 2, etc. We must find the div with this title
    >>
    > var titlePattern = new RegExp (well); for example /section2/
    > var divs = document.getElementsByTagName("DIV");
    >>
    > for (var i = 0; i)< divs.length;="" i++="" )="" {="" cycle="" through="" all="" the="">
    > var oneDiv = div ; //putting each in oneDiv
    > match = titlePattern.exec (oneDiv.getAttribute ('SECTION') var
    >> ); Search in the div to see if it matches the string, section2\b or some
    > such
    >>
    > If (match! = null) {//then is our div, so we switch her}
    > visibility
    > If (oneDiv.style.display == 'none') {//if the text is reduced
    > oneDiv.style.display = "inline"; display text
    > document.getElementById (imgID) SRC =
    > "' http://www.info.apple.com/images/kprocedure/Scripts/buttons/hide.gif '; "
    > document.getElementById (imgID) .alt = 'hide ';
    > return;
    >> }
    > {else}
    > oneDiv.style.display = "none"; otherwise, the text is displayed, thus
    > Reduce it
    > document.getElementById (imgID) SRC =
    > "' http://www.info.apple.com/images/kprocedure/Scripts/buttons/show.gif '; "
    > document.getElementById (imgID) .alt = "show";
    > return;
    >> }
    >> }
    >> }
    >> }
    >>
    >
    >

  • Master page of substitution InDesign JavaScript element

    Hi guys

    I can't get a master page item substitute work.

    The code below what should I put as a destinationPage?

    Currently, I get an error message "invalid object for this request.

    myDoc var = app.activeDocument;

    var myPages = myDoc.pages;

    var myDoc.pages = myItems [0].appliedMaster.allPageItems;

    for (y = 0; y < myItems.length; y ++) {}

    If {(myItems [y] instanceof TextBox)}

    myItems [y] .override (myPages [0]); //This bit does not work. What I put here like destinationPage?

    }

    }

    Thank you

    Hello

    Try this...

    var myDoc = app.activeDocument;
    var myItems = myDoc.pages[0].appliedMaster.pageItems.everyItem().getElements();
    for(var y=0;y		   
  • Creating a color in InDesign Javascript (CC)

    Hi all:

    I use this code to try to create a color that can be used to fill a button:

    function MakeButtonColor()

    {

    var TheColor;

    var editable = app.activeDocument;

    var MonErreur;

    Try

    {

    TheColor = TheDocument.colors.item ("DPSButtonColor");

    var ColorName = TheColor.name;

    }

    catch (MyError)

    {

    TheColor = TheDocument.colors.add ({name: "DPSButtonColor", colorSpace:ColorSpace.RGB, model:ColorModel.process,colorValue:[0,137,208]});})

    }

    var ButtonColor1 = TheColor;

    Alert ("ButtonColor is" + ButtonColor1.name);

    }

    I am all that directly from the Scripting Guide with only a very few changes.

    But I never see the two last executed statements.   I tried all sorts of things to make this work and it won't work.

    Someone at - it ideas why this won't work and what I can do about it?

    Hi JADarnell,

    I just modified your code according to the directives of the Trevor mentioned lines. Try this!

    MakeButtonColor()
    function MakeButtonColor(){
       var TheColor;
       var TheDocument = app.activeDocument;
       var myError;
       try{
           TheColor = TheDocument.colors.itemByName("DPSButtonColor");
           var ColorName = TheColor.name;
           }
       catch(myError){
           TheColor = TheDocument.colors.add({name: "DPSButtonColor", space:ColorSpace.RGB, model:ColorModel.process,colorValue:[0,137,208]});
           }
       var ButtonColor1 = TheColor;
       alert("ButtonColor is " + ButtonColor1.name);
       }
    

    THX,

    csm_phil

  • Configure the execution of the procedure at regular intervals?

    I have a package with PL/SQL functions and procedures, and I want to run some of them on a regular basis. Is it possible to configure the database server to run a procedure, say every Monday at 02:00 (AM)?

    Published by: user7095399 on 05:42 19.aug.2010

    DBMS_SCHEDULER serves your purpose. Check out the following:

    http://www.Oracle-base.com/articles/10G/Scheduler10g.php

  • Double beep at regular intervals on Satellite P100 series

    Hello
    I just bought a Satellite P100 laptop.
    The laptop makes a double beep every few minutes, even if I unplug the power.
    When I disable, the ringing continues.
    The speakers do not seem to work, even if the volume settings are all on.

    Thank you for the help,
    At soon Larso.

    Hello Larso

    Did you install own OS or you are using already preinstalled at the factory?

    In my opinion these things should not happen, and if I were you I would dealer and him to confront these issues. The device is new and before starting any kind of troubleshooting check that with garage.

    The only thing you can try is to preinstall unit with recovery media. On this way the OS will be own pre-installed and you can check if the problem persists.

  • HOW TO INTRODUCE THE POINT OF TENSION ON THE SPECTRUM OF FREQUENCY AT REGULAR INTERVALS

    Good day everyone

    Can you guide me how to add spikes to magnitude-200 dB amplitude to frequency 60,120,180,240,300 Hz intervals in frequency spectrum I got using the FFT power spectrum. I have attached the graph to which I want to have more amplitude spikes.

    Concerning

    Automata

    Here it is to Format 8.2.

Maybe you are looking for