Why it will not work at startup?

#targetengine "session"   
    var myDocument = app.documents.item(0);
    var myStory = myDocument.stories.item(0);
        myStory.trackChanges = true;  

I put this script in the Startup Script file, but it gives me an error on line 3.  When I have the script in the Script Normal folder and click on it, it works.

Please use the following code and let me know if all is well. I made a few changes and explained below:

#targetengine session

var myEventListener = app.eventListeners.item("TurnTCon");

if (!myEventListener.isValid) {
    myEventListener = app.addEventListener("afterOpen", doJob1 );
    myEventListener.name = "TurnTCon";
}   

function doJob(event) {
    try{
        if(event.parent.constructor.name == "Document") {
            var myDocument = event.parent;
            if(myDocument.stories.length > 0) {
                var myStory = myDocument.stories.everyItem().trackChanges = true;
            }
        }
    }catch(e) {  }
}

Comments:

1. to better understand #targetengine session in the first line of your script

2. the "afterOpen" event fires not only documents, but also for windows (layoutwindow, storywindow, etc.).

Thus, you will need to filter DocumentEvent only and the appropriate error handling is necessary, as I've done above.

Your previous code could have probably misinterpreted the activeDocument when it responds to an event the afterOpen window.

For example, activeDocument does not agree in all places.

3. one of your line says: myDocument var = app.activeDocument (); A possible runtime in your code error.

They should be app.activeDocument is NOT a function. In addition, do not use activeDocument.

Consider the code above that gets rid of it.

4. the missing links dialog box should not be a problem. I checked it.

5 NOTE: Your document is still open as DIRTY as you are editing during the opening of the document (by turning on track changes). Hope that you have found my point here.

Tags: InDesign

Similar Questions

  • Why Bitmoji will not work with iOS 10?

    Why Bitmoji does not work with ios10?

    What I found was that by changing the bitmoji keyboard and turn it back on, the selections of bitmoji are back. Good luck!

  • Why lonely will not work with Firefox 12?

    Maps will not move alone

    Run all Windows updates, install all required service packs, etc.

    Updating your graphics driver (Firefox uses the graphics card for rendering and an outdated graphics card driver can cause problems. https://support.mozilla.org/en-US/kb/how-do-i-upgrade-my-graphics-drivers.

    Update all of your plugins (Flash, Java, etc.): http://www.mozilla.org/plugincheck/.

    Download and install MalwareBytes Anti-Malware, run a full scan. http://www.malwarebytes.org/. This check allows that there is no virus on your computer, causing problems. You can uninstall this program after having cleaned the infections.

  • Why gearview will not work under windows 8

    How can I look at the x-rays using gearview that were previously running using windows 7

    Normally the DVD includes viewing software.  If you do not have a viewer, or it does not work for you, you could try the viewer MicroDicom.  Unlike GearView, this viewer has worked for me in Windows 8.

    Here are the download links.

    32-bit version:

    http://www.microdicom.com/component/DOCman/doc_download/81-microdicom-Viewer-081-x86.html

    64-bit version:

    http://www.microdicom.com/component/DOCman/doc_download/82-microdicom-Viewer-081-x64.html

  • Why FireFox will not work on my system? (Windows 7) Help.

    This is the error message I get when trying to open FireFox

    "Could not load your Firefox profile. It may be missing or inaccessible. »

    I do not use one of the browsers 'Brand-X', and I wish have FireFox works again. My operating system is Windows 7.

    Help, please. I don't know what to do.

    Thank you

    Mark S. Pannill

    Mark, I mentioned, if you see not all profiles in the list, NOT DELETE one of them. It would be fatal.

  • Why vMotion will not work with an IP from DHCP, but not a static IP address?

    I have a bit of a puzzle game. I'm trying to implement vMotion on our new leaves. They run VMWare ESX 4.0.0 208167. I've implemented the VMkernel on a separate vSwitch. When I try to use a static IP address, I get various errors about the connection being reset by the peer or that he was unable to send a copy before starting the message to the remote host, or that he was unable to receive bytes from the remote host.

    However, if all I do is go to the VMkernel and switch to a static IP address to DHCP on the IP settings tab, it rolls. And, as far as I can tell, everything is exactly the same except for the last digits of the IP number (static IP is 10.11.129.148, DHCP is 10.11.129.64). The subnet mask looks the same, and the default gateway is the same. Only these latest figures do not.

    DHCP always appears to pick up the same IPs for the blades, so I'm just a bit puzzled as to why the last digit would make a difference, if there is no other device on the network with this IP address.

    Thank you!

    Keith

    It is absolutely not a DHCP or static IP address. If static IP adrresses don't wor the you must check all your settings and check for IPs in doubles.

    ---

    MCSA, MCTS, VCP, VMware vExpert 2009

    http://blog.vadmin.ru

  • Why addChild will not work with an Image object in Flashbuilder

    Hello. It's pretty basic... Why does this job:

    public var img:Image = new Image();

    IMG.source = @Embed...

    addChild (img)

    for some reason any cannot get the img to display and get error messages. any suggestions? thanx

    This isn't the right way to include images in your application, look here:

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=embed_4.html

  • Windows XP will not respond to the keyboard or the mouse. Why it is not working.

    Well, I have the version of Windows XP Home Edition-32, Service Pack 2. I bought a keyboard gear yesterday with a mouse optical usb Dynex. My old keyboard and mouse were completely irreparable; I threw the. I plugged my new usb devices. When Windows has finished loading need me for my logon screen. However, my mouse and keyboard will not respond. This prevents me from going further. In addition, they will not respond during startup, the BIOS or the Windows Advanced Options Menu. I don't have a recovery disk. I bought the computer with XP already on this subject, so I do not have the disk to the operating system. What is my next step?

    I bought PS/2 devices, and they work perfectly. Thanks for the tip.

  • Windows 7 does not start; Startup Repair won't work; Know last good configuration will not work

    Windows 7 64 bit machine. Automatic Windows updates were installed during the night; has started acting strangely this afternoon.  After an attempt to re-start, got the "Windows Error Recovery" screen with the "Windows did not start. A recent message HW or SW change might be the cause".  When I try to 'Launch Startup Repair' a screen returns but just hangs.  When I try to "Start Windows normally", it brings back me to the Windows error recovery screen.  When I hit f8 for when you start to get the screen "Advanced Boot Options" and try to go into secure Mode or use the last good known Configuration option, each one brings back me to the Windows error recovery screen.

    Any ideas on how to get this resolved?  Thank you!!!

    Hello

    The problem is since it will not run the startup from the Windows 7 disc repair you then you
    need some kind of support, and the cause is likely to be material. A Dell thing you want to do
    is to restore the system back to the factory plug 'IF' possible so it would be a good idea to save the
    data before calling their (possible an another 'IF'). Try to put the hard drive in another computer
    as the 2nd disc (best method) or in an external case USB (less likely to work) and then copy
    data on removable media such as CD, DVD or other external USB drives.

    Good idea to check with the technical support Dell, their online documentation and the Dell forums where he
    perhaps others with the same problem.

    Dell support
    http://support.Dell.com/

    Dell support drivers - product manual & warranty Info (left side) - and much more
    http://support.Dell.com/support/index.aspx?c=us&l=en&s=DHS

    Dell forums
    http://en.community.Dell.com/forums/
    Other choices would be a real store of the computer performing the internal repairs (not the leeks and the glances at one
    Best Buy or other stores). Of course if she has any warranty Dell is the best choice, and
    can be in effect regardless of any warranty.

    I hope this helps.

    Rob Brown - Microsoft MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Telstra Australia tell me that I have to use Chrome, as their facilities will not work with Firefox. Why?

    After spending literally hours trying to pay an account on Telstra Australia (that I just joined them, so it's the first installment), I finally gave up and contacted directly. I was told that Telstra services will not work with Firefox and that their preferred system is Google Chrome but Internet Explorer will not work.
    I have used Firefox for a long time and I'm happy with the program. Specifically, I have everything set up to work with Firefox and do not want to change. At the same time, I want to have the convenience of paying bills online.
    Can I load up, Google say, just one thing, or the program will then try to "catch" other functions as well?

    Yes, you can install Chrome and use it for a website. "Recovery" Chrome as other functions on your PC, just don't let it not be defined as "browser default" If you are prompted during the installation procedure. In addition, I doubt if you'll have a problem.

  • Updated to iOS 9.2.1 and my flash or flashlight will not work? Why?

    SO I have updated to iOS 9.2.1 and my phone flash will not work, nor does my flash light! I don't have hard rest yet because I want to see if I can live without that maybe it's a bug, but I turned the phone market and I also did a still nothing of rest (hold the power and home button) can anyone help or have what, starting

    Are you sure that the update has caused the problem? If so, I think that a restore may be the best solution.

    If that doesn't work, restore your device to factory settings. Please note that this will delete the data on your device.

    Take a look this Apple Support article: use iTunes to restore the iPhone, iPad or iPod to factory settings - Apple Support.

    As a final step, try recovery mode. Turn off your unit, then plug it to your computer with the hold home button. Hold down Home button until you see the logo of iTunes on the screen of your device. After that on your computer, you should see the iTunes window saying that your device needs to be restored to factory settings. Click Restore.

    More info here:

    https://support.Apple.com/en-us/HT201263

    If these steps do not work, contact Apple and ask for help.

    https://www.Apple.com/support/iPhone/contact/

  • After Vista Ultimate Clean install battery Manager will not work Rundll32.exe error at startup

    I did a clean install of Windows XP SP3 Vista Ultimate SP 1. It was a total reload once installation is complete I used the insall system update all the drivers. Now Manager of battery will not work right, when I boot it hangs with an error rundll32.exe. I tried to uninstall and reinstall and allowed me at least open the program a bit, but there is no power management in the Manager. He says that I can create a new, but he does not appear once it is made. I can't counter is displayed in the taskbar and at this point I'm kind of at a loss.

    Any help would be great

    Thank you

    I have actully solved my problem. What I had to do was reboot the machine and after Vista installation was done I did the installation of battery first Manager and just downloaded from the section the T61 drivers (without using the update system) then once the battery Manager installation manual was full (it was then works well) I ran the system update to install the rest of the drivers and utilities Lenovo. If apperentally battery meter do not be installed via updater. My sugestion would be so to reload the machine once more and battery Manager install before running system update this is what worked for me.

  • Why Silverlight don't is not supported in future versions of Firefox Silverlight is a necessary component of the STAN does this mean Stan will not work in future versions

    I read that Silverlight is not supported in Firefox 52 + Stan requires silverlight to function does this mean STAN will not work with Firefox 52 +.

    This one? https://www.Stan.com.au/

    At some point, all THE plugins using the NPAPI interface are intended to stop working in Firefox. If all goes as planned, the Firefox 'support extended-release' (ESR) next spring will allow you to continue to use Silverlight for the rest of the year, while Stan has plenty of time to switch to alternatives. Or you can use Internet Explorer, if they are not.

  • By Magentic screen saver will not work! Any help out there?

    I am running Windows Vista on a Dell Studio nine
    I've got everything I can think of including related: put in startup, uninstall/reinstall, which makes my choice by default, even turning off security on downloads & installs.  But Vista refuses to launch... (And I do not understand it is maybe not the best choice, but it makes me happy... & I need that now..) Please any help will be appreciated! Thank you!

    Hello MakMeHappy,

    Thank you for using the Microsoft answers Forum

    We want to assure you that Magentic is compatible with Windows Vista. I downloaded this background screen program on my laptop but got errors repeated that he could not install. You are using a version of this software which is known to be compatible with Windows Vista? Is there an another Vista machine that you tried this software and it worked? Are there errors that either Vista or the Magentic software gives which would give us more information as to why it does not work. Have you contacted Magentic support to ask if the software is compatible or if they have a version that will work correctly on Windows Vista?

    Additional information you can provide on this problem would be useful.

    Judd
    Engineer Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Would you like to share why you must do a clean install?

    You can try the recovery of the internet (which will work if your older model has been updated to enable of): hold command + Option + R until you see a progress bar (take a while). It will connect you to the Apple servers. When you see the utility window, choose disk utility to erase your disk and when you're done, choose to reinstall OS X.

    Computers that can be upgraded to use OS X Internet Recovery - Apple Support

    PS: Correction: I think not yours can be updated; in this case, you will need the original installation disks to wipe the drive and reinstall.

Maybe you are looking for