AIS CC: how undoing the actions of a JS run via app.doScript

Hello,
AIS CC (9.0)
I wrote a JavaScript, which I can properly run through app.doScript(UndoModes.fastEntireScript, etc.).
Now, at a given time, I would like to programmatically undo the actions of my own script.
The various resources I have got here (InDesign_ScriptingGuide_JS (CS6), InDesign_ScriptingTutorial, the ExtendScript Toolkit Object Model browser) suggest things (app.undo(), app.documents.item(0).undo(), etc.) which fail, when executed on my AIS CC.
Any idea or tip, on how to undo actions submitted via doScript on AIS CC?
Thanks in advance!
Kind regards,
GB
Snippet:
var main = function()
     // something
app.doScript(
     main,
     ScriptLanguage.javascript,
     undefined,
     UndoModes.fastEntireScript
     ); // << this works perfectly: the actions in the "main" function are executed
app.undo(); // << this will fail with "app.undo is not a function"

Thanks for your fast reply.
you're undoing the entire script, which is probably not what you want.
Undoing everything embedded in my "main" function is really what I want to achieve.
Whether it's a bunch of complex code, or nothing at all (as in my snippet, where "main" contains only a comment line ), it's what I want.
the recommendation is to us entireScript
I changed my "UndoModes.fastEntireScript" into "UndoModes.entireScript", as you suggested; with no avail so far: I still get the same "is not a function" error.
Actually, I have the feeling that I do not understand/master the InDesign DOM here, and am simply trying to make a call to a method (undo) which does not exist in this class (app) - despite the Adobe Reference Manual says it does...
It sounds an inefficient way to write a script
My script makes some changes in an InDesign document ("main" function), then exports it to PDF (out of the "main" function).
Then, the environment I work with (XMPie) will inject variable information in the InDesign document for the next recipient.
At this time, I need the document to be reset to its original design.
That's why I need to undo all the changes applied by the "main" function.

Similar Messages

  • How can I config my jsp application run via port 80 or 443

    Hi All,
    I had jsp application, I deployed into Oracle Application Server 10g, when I test http://myhost.mydomain:7781/myapp then it is ok.
    Could you show me the way to config myapp run via default port 80 in Oracle As 10g. It is that if I input http://myhost.mydomain/ then it refrence to my jsp aplication.
    Thank All.
    Thanh.

    Thanh,
    check the $OracleAs_Midtier_Home/install/portlist.ini file for the ports that are configured for Oracle Application Server.
    If port 80 wasn't configured for the HTTP Listener then you will have to change the Application Server listener settings to make this work the way you want it.
    From the "Oracle Application Server 10g Administrator's Guide 10g (9.0.4) "
    Using the Application Server Control:
    Navigate to the Application Server home page and click Ports.
    On the Ports Page, locate the Oracle HTTP Server Listen port and click the icon in the Configure column.
    On the Server Properties Page, in the Listening Addresses and Ports section, enter the new port number in the Listening Port column. There may be more than one listening port listed. The only way to tell which is the non-SSL listening port is to choose the one with the old non-SSL listening port value.
    At the bottom of the page, click Apply.
    On the Confirmation Page, click No, you would not like to restart now.
    Using Manual Steps:
    Edit the following file:
    ORACLE_HOME/Apache/Apache/conf/httpd.conf
    Update the Listen directive with the new port number. Do not update the Port directive.
    There may be multiple Listen directives in this file. Modify the Listen directive that is not enclosed in an SSL virtual host container. The easiest way to locate the proper Listen directive is to search the file for the old listen port number.
    Save and close the file.
    Run the following command:
    dcmctl updateConfig -ct ohs
    Frank

  • How define the action of a h:form?

    Hi, I have a page that is accessed with http that contains a form which needs to be posted to a https action. As there is no way to define the action attribute for a h:form tag, how can I implement this using the h:form tag? Is there a way to make the commandButton tag action attribute point to a url?

    With JSP+Servlets in Tomcat I would do something like this
       <form action="https://${pageContext.request.serverName}:8443${pageContext.servletContext.contextPath}/Login?action=login" method="post">
             <label for="username"><fmt:message key="user_username"/>:</label><input type="text" name="username" id="username" value="${username}"/>
             <br/>
             <label for="password"><fmt:message key="user_password"/>:</label><input type="password" name="password" id="password" value=""/>
             <br/>
             <input type="submit" value="<fmt:message key="login"/>"/>     
       </form>how I do something similar using JSF html tags?

  • Is there a way to rollback or undo the actions committed by remediation?

    For example, we create a configuration item to check if anti-virus service is present and running on our application servers, and if it is not, to remediate the condition by starting the service.  We deploy this CI in a baseline to a collection and
    several servers are found to be non-compliant.  The deployment remediates the condition by starting the AV service which subsequently causes the servers to blue screen. Questions:
    How do we rollback or undo the remediation?  Do we remove the CI from the Evaluation Conditions in the baseline? or change revision? 
    What is the affect of this - are settings on the servers returned to their previous state?

    You can't rollback or undo the remediation. You can remove the Remediate noncompliant rules when supported
    checkbox in the deployment, but that won't undo previous remediation's. It will only prevent future remediation's.
    See point 1, it won't return the server to the previous state. To do that you need to create a custom script, or a configuration item that does exactly the opposite.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • F110 for the proposal action only,not the action to generate payment run

    The user needs to be able to use tcode F110 for the proposal action only, but not the action to generate the payment run.
    Please advise me specifically what action to be taken to reach that objective and whose task is this....Security people will do or FI only.

    Hi,
    Provide Authorization up to praposal only.
    With Help of Basis Team you will restrict user authorization.
    Authorization Activities:
    02         Edit parameters
    03         Display parameters
    11         Execute proposal
    12         Edit proposal
    13         Display proposal
    14         Delete proposal
    15         Create payment medium proposal
    Provide Access 02 to 15 the user can able to execute up to praposal.
    21         Execute payment run
    23         Display payment run
    24         Delete payment run payment data
    25         Create payment media of payment run
    26         Delete payment orders of payment run
    31         Print payment medium manually
    Regards
    Viswa

  • How is the latest gen of photoshop running on the new mac pro?

    Hi - I am running a 2009 mac pro and it is having trouble keeping up with my demanding photo editing - I am planning to purchase the new model in the next week or so - wondering how compatible the Adobe software (especially Photoshop ) with the GPUs etc.
    thanks in advance-
    boswell

    Visit what www.macperformanceguide.com has to say - you are right down his alley in terms of needs and uses.

  • How to take action when vi stops running

    Sorry for the newbie question but I can't seem to find the answer anywhere. How do I go about taking action such as turning off leds or reseting some variables when my vi stops running. Is there some sort of boolean flag that I can read to determine if the vi is running or a flag that gets set when the vi terminates? Thanks in advance.
    Solved!
    Go to Solution.

    The state of the LEDs should not be important if the VI is not running (edit mode), it is however probably important that they are off next time you run the VI.
    To make sure that indicators start out at the desired defaults when the VI starts running, go to "VI properties...Execution" and enable "clear indicators when called".
    LabVIEW Champion . Do more with less code and in less time .

  • How does the invoke event for an Air iOS app work?

    Hi,
    If my app gets invoked for the first time the invoke event isn't fired.
    If the app gets invoked for the second time it is working.
    How to get the event.arguments[0] every time the app gets opened/invoked?
    NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onAppInvoke);
    function onAppInvoke(event:InvokeEvent):void {
    trace("INVOKE ARGS: "+event.arguments[0]);
    Thanks

    Helo fideld, officially Adobe Air don't support Danish language. But I may help you.
    1. Download this file https://www.dropbox.com/s/ytx44mxzdgmlfq2/adt.jar
    2. Go to Air SDK\lib\ folder and backup your original adt.jar
    3. Copy my one from step 1
    You may understand that patched adt.jar was produced by me and not by Adobe.
    I just done this for you as a part of community friendly support. It's allow to add "da" language.
    1. Open your *-app.xml
    2. Add lang="da"
    3. Go to supportedLanguages in XML and add "da" also there so it's will be like "en fr de da".
    Patched ADT was made from original latest 4.0.0.1619 and you must use http://labs.adobe.com/downloads/air.html 4.0.0.1619 before apply this patch
    This works well, just tested!

  • How is the output of TempDBAnalysis.sql run during a SQLDiag.EXE session used to troubleshoot tempdb contention?

    Hi,
    I recently came across the option in PSSDiag configuration utility to collect data using the "SQL 2005 tempdb Space and Latching" option.  I executed this on a test server and it generated the file {servername}_TempDBAnalysis_Startup.out. 
    This contains the output of a set of queries that are run in a 10s loop. 
    I have two questions regarding this output.
    1.  Are there any of the analytical tools in SQLNexus or PAL that display, summarize, or trend this data in any way? I do not see any but would like to confirm with the forum.
    2. If there are no analytical outputs, is there any summary out on the web of how to analyze this data, how to import it into a db, or how to interpret the output of each individual query?
    Thanks in advance for any assistance in this matter!

    Hi Lorrin,
    You can reference the below links.
    Tool to help you analyze SQL Server SQLDIAG and PSSDIAG output
    How to use SQLDiag, SQLNexus and PAL tools to analyze performance issues in SQL Server
    If you have any feedback on our support, please click
    here.
    Eric Zhang
    TechNet Community Support

  • How do I get Windows 8.1, run via Bootcamp, to detect an external HDMI display

    Good afternoon,
    So earlier today, I managed to install Windows 8.1, via Bootcamp, on my 15' MBP retina with Iris pro 5200 integrated graphics (Late 2013). I cannot figure out how to get the dang thing to recognize my TV through an HDMI cable. I did have it kinda sorta working the first time I installed Windows on my MBP with bootcamp, but that installation failed. What do I need to do to fix this problem?
    Summary:
    Using a 15' MBP retina with Iris Pro 5200 graphics. This is not the model with the nvidia graphics card.
    This current installation seems to be working without too many problems.
    Windows 8.1 will not detect my tv, and yes, the HDMI cable is plugged into both the TV and the MBP.
    Why is Windows on my MBP failing? It seems like everything is set up properly.
    (I know I could do some weird combination of Thunderbolt to eventually HDMI, but I have not tried this)
    I simply want to plug an HDMI cable into my TV and my MBP.
    I do have a regular windows desktop, and this works without any problems (besides being windows)
    Thanks for any help you guys can offer.

    with my imac it worked as automatically as in OS X my video card is amd though and the monitor is dvi rather then hdmi

  • How to create a JButton that can run other Apps?

    Hi, Every1
    i want to create a JButton which can let the user click it and it runs a
    specified installed app in the system ( say, a JButton that fires up MS
    Outlook). how can i do that?
    thank you very much.
    Yu.

    hi, if i want to execute some kind of the following, how would i handle it?
    mailto:[email protected]
    i tried: Runtime.getRuntime().exec("mailto:[email protected]");
    but it gave me java.io.IOException: CreateProcess: mailto:[email protected] error=2
    i think this problem would be relatively easy but i just cant figure out.
    thanks

  • Error while running the SAP JCO java program running via command line

    Hi,
        We are facing an issue while using SAP JCO. When i try to run the sample program using RAD 8.0 ( IBM IDE tool For Java Development) its working fine.
    The same sample program if i try to run using command line, Then its giving below exception message.
    Exception in thread "main" java.lang.NoClassDefFoundError: Integration
    NOTE: I have configured proper sapjco jar & Dll files path in class path settings in my batch file.

    Hi,
    class loader can't find class definition during runtime but it could find it during compilation. So the problem is with your classpath. Does your classpath point to file with class Integration? Check this [blog|http://javarevisited.blogspot.com.au/2011/06/noclassdeffounderror-exception-in.html].
    Cheers
    Added reference to blog.

  • Will the Journ.e Touch ever run WinCE Apps?

    My colleague has bought the Journ.e Touch 'cause the LK8000 (.it) flight software requires WinCE or similar to run, and the dealer where he bought it told him that this device meets the requirement (runs WinCE 6.0).
    Of course the packaging materials were thrown away asap, and I don't have to tell here that this device does not run WinCE applications, for whatever reason.
    Is there any way to crash the Toshiba application and access the operating system, or any custom firmware which allows to access WinCE or run applications, or any future plan to 'free' the device from its application restrictions? Any way to make the Journ.e Touch usable?
    Many telephones can run the LK8000 software (and have gps onboard), damn, it's so annoying.

    Hello,,
    i am from Germany.
    Bad English.
    Connect tablet with PC via USb.
    You find a directory "Opera".
    Save the exe. Then copy "Total Comander" (file manager) CE-Version into the directory.
    Rename it to original name of opera exe.
    Then you can start from Startmenu the filemanager and use wince progs fom sd card.
    Its very helpful, because their a many progs in the net.
    Have fun

  • Urgent, undo the erase option on find my iphone

    hello everyone, my ipad was stolen tonight and I activated the earse option on view my iphone app by wrong, I want to undo it so that I can lock and locate it... any solution?

    I believe it is not possible to undo the action.
    But in my opinion this is not important.  Usually stolen iOS devices are immediatly erased and you will have no chanche to locate them.
    I had the same experience.  Sorry.

  • Need to pause the action

    I have one action with 15 steps . How can the action pause at 7th and 11th step in 5 seconds ? I insert Stop but after the action stops I have to click play button to continue- it takes time. Thanks for your help.

    You can use the built-in action pause playback option but you will need to create two scripts. One to set the option to pause and the second to set it back normal.
    function setPlayback( optionID, seconds ) {
        //stringIDToTypeID('accelerated')
        //stringIDToTypeID('pause')
        // second argument required only when id = pause
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('PbkO') );
            ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
            var optionsDesc = new ActionDescriptor();
            optionsDesc.putEnumerated( stringIDToTypeID('performance'), stringIDToTypeID('performance'), optionID );
            if(seconds!=undefined) optionsDesc.putInteger( stringIDToTypeID('pause'), seconds );
        desc.putObject( charIDToTypeID('T   '), charIDToTypeID('PbkO'), optionsDesc );
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    setPlayback( stringIDToTypeID('pause') , 5 );
    and
    function setPlayback( optionID, seconds ) {
        //stringIDToTypeID('accelerated')
        //stringIDToTypeID('pause')
        // second argument required only when id = pause
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('PbkO') );
            ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
            var optionsDesc = new ActionDescriptor();
            optionsDesc.putEnumerated( stringIDToTypeID('performance'), stringIDToTypeID('performance'), optionID );
            if(seconds!=undefined) optionsDesc.putInteger( stringIDToTypeID('pause'), seconds );
        desc.putObject( charIDToTypeID('T   '), charIDToTypeID('PbkO'), optionsDesc );
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    setPlayback( stringIDToTypeID('accelerated') );
    Then where you need the pause have the action run those two scripts.

Maybe you are looking for