Sg2.9
Another carriage return bug
Recent RSS
Another carriage return bug
Date:  2. May 2006, 01:07

One more bug. Select a text box, execute the following code, undo, then execute it again.
(Works fine when there isn't a carriage return in the string.)

var textbox=activeDocument.selectedItems[0];
textbox.range.content="testr";

I get a spinning beachball for a while, and then it outputs the following error to the console:

Wrapped java.lang.NullPointerException (/Users/synch/Desktop/stuff/Code & Research/New Scriptographer scripts/test.js#2)
java.lang.NullPointerException
at java.util.StringTokenizer.(StringTokenizer.java:146)
at com.scriptographer.ai.TextRange$TokenizerList.adjustEnd(TextRange.java:493)
at com.scriptographer.ai.TextRange.adjustEnd(TextRange.java:163)
at com.scriptographer.ai.TextRange.append(TextRange.java:173)
at com.scriptographer.ai.TextRange.setContent(TextRange.java:193)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142)
at org.mozilla.javascript.JavaMembers.put(JavaMembers.java:142)
at org.mozilla.javascript.NativeJavaObject.put(NativeJavaObject.java:114)
at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1396)
at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1432)
at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1422)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2824)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:160)
at com.scriptographer.ScriptographerEngine.executeScript(ScriptographerEngine.java:252)
at com.scriptographer.ScriptographerEngine.executeFile(ScriptographerEngine.java:299)
at com.scriptographer.ai.Tool.setScript(Tool.java:66)
at com.scriptographer.gui.MainDialog$ToolButton.onClick(MainDialog.java:285)
at com.scriptographer.adm.Button.onNotify(Button.java:75)
at com.scriptographer.adm.NotificationHandler.onNotify(NotificationHandler.java:55)
java.lang.NullPointerException
at com.scriptographer.ai.Tool.setScript(Tool.java:68)
at com.scriptographer.gui.MainDialog$ToolButton.onClick(MainDialog.java:285)
at com.scriptographer.adm.Button.onNotify(Button.java:75)
at com.scriptographer.adm.NotificationHandler.onNotify(NotificationHandler.java:55)

Re: Another carriage return bug
From:  Jürg Lehni
Date:  2. October 2006, 14:23

Finally fixed in 2.0.019

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Ideé replacer 02.07.11
by peko