2 Replies Latest reply on Jul 19, 2013 4:16 AM by gert verrept

    error with function in indesign cc 64bit

    gert verrept Level 2

      When trying to use the function below, I get this error. Upto now we use the 32bit version (cs6), but with the switch to CC, we're using the 64bit version on windows 7 enterprise (64 bit).

      Any suggestions?

       

      G

       

      errorCC.jpg

       

       

      function datum_en_username() {

       

       

                                       var get_username = 'myName = GetUserName\n'

                get_username = get_username + 'Set myInDesign = CreateObject(\"InDesign.Application.CS9\")\n'

                get_username = get_username + 'Set myDoc = myInDesign.ActiveDocument\nmyDoc.InsertLabel \"getUserName\", myName\n'

                get_username = get_username + 'Function GetUserName()\n'

                get_username = get_username + 'Dim objWSHNet, strCurrentUser\n'

                get_username = get_username + 'Set objWSHNet = CreateObject(\"WScript.Network\")\n'

                get_username = get_username + 'strCurrentUser = objWSHNet.UserName\n'

                get_username = get_username + 'Set objWSHNet = Nothing\n'

                get_username = get_username + 'GetUserName = strCurrentUser\n'

                get_username = get_username + 'End Function'

       

       

                var datum = new Date();

       

       

                app.doScript(get_username, ScriptLanguage.visualBasic);

                username = app.activeDocument.extractLabel('getUserName');

       

                return [datum, username];

       

       

      }