2 Replies Latest reply on Apr 5, 2010 2:01 AM by beyond1117

    Microsoft  Visual C++ Library Runtime Error

    beyond1117

      when I use AE CS 4 execute the JavaScript,an unknown error occurred.Think a lot of ways,but still can not.Please help me.

      123.jpgThe left is the error picture,please help me!!!

        • 1. Re: Microsoft  Visual C++ Library Runtime Error
          Mylenium Most Valuable Participant

          What exactly do you do? Please be more specific! Does the error occur on program startup? What operating system do you use? What script are you referring to?

           

          Mylenium

          • 2. Re: Microsoft  Visual C++ Library Runtime Error
            beyond1117 Level 1

            My operating system  is Windows Xp Sp3.The script  is JavaScript file.when the scripts execute finished,that dialog occured.

            The script contents is follow:

             

            var myFile = new File("\D:\\music\\Music.aepx");
            app.open(myFile);
            var oneDuration = app.project.item(2).duration;
            var twoDuration = app.project.item(3).duration;
            var threeDuration = app.project.item(4).duration;
            var comp  = app.project.item(1);
            var templateDuration = 500;
            comp.layer(1).startTime = 0;
            comp.layer(2).startTime = oneDuration-5;
            comp.layer(3).startTime = oneDuration + twoDuration-10;
            app.project.item(1).workAreaDuration = templateDuration;
            if (comp.layer(1)("audioLevels").numKeys > 0) {
            for (var i = comp.layer(1)("audioLevels").numKeys; i >0 ;  i--){
            comp.layer(1)("audioLevels").removeKey(i)}}
            if (comp.layer(2)("audioLevels").numKeys > 0) {
            for (var i = comp.layer(2)("audioLevels").numKeys; i >0 ;  i--){
            comp.layer(2)("audioLevels").removeKey(i)}}
            if (comp.layer(3)("audioLevels").numKeys > 0) {
            for (var i = comp.layer(3)("audioLevels").numKeys; i >0 ;  i--){
            comp.layer(3)("audioLevels").removeKey(i)}}
                 comp.layer(1)("audioLevels").setValue([0,0]);
              comp.layer(2)("audioLevels").setValue([0,0]);
              comp.layer(3)("audioLevels").setValue([0,0]);
            if (oneDuration > templateDuration){
            comp.layer(1)("audioLevels").setValueAtTime(templateDuration-5,[0,0])
                comp.layer(1)("audioLevels").setValueAtTime(templateDuration,[-40,-40])
               }else if (oneDuration + twoDuration > templateDuration+5){
                comp.layer(2)("audioLevels").setValueAtTime(templateDuration-5,[0,0])
                comp.layer(2)("audioLevels").setValueAtTime(templateDuration,[-40,-40])
               }else{
                comp.layer(3)("audioLevels").setValueAtTime(templateDuration-5,[0,0])
                comp.layer(3)("audioLevels").setValueAtTime(templateDuration,[-40,-40])
               }
            var myFile = new File("\D:\\music\\temp.aepx");
            app.project.save(myFile);
            app.quit();