8 Replies Latest reply on Mar 29, 2010 3:43 AM by Harbs.

    [JS][CS4/Mac] doScript differs from running 'normally'

    [Jongware] Most Valuable Participant

      Hi guys 'n' gals,


      Pretty annoying: after writing a long script and getting tired of undo'ing a zillion times if I made a mistake, I decided to wrap up the entire thing into a doScript call. Now suddenly the .substr function stops working!


      Error Number: 24

      Error String: expr.substr is not a function


      Source: app.doScript (doMyStuff, ScriptLanguage.JAVASCRIPT, [stuff], UndoModes.ENTIRE_SCRIPT, "What the..!?");


      Sounds familiar?


      I have had a few clashes before, with string functions that appeared to work fine and suddenly stopped working (indexOf, charCodeAt), but these seemed to disappear as if by magic. Although I have been switching writing this script between Mac and Win, so these have may been conflicts in a Javascript dialect?


      This, however, is stumping me.