Article View: adobe.scripting.indesign
Article #17765Assert error in InDesign when running script
From: John Darnell
Date: Wed, 14 May 2003 21:13
Date: Wed, 14 May 2003 21:13
73 lines
3055 bytes
3055 bytes
Hello Fellow Scripters:
As mentioned in an earlier post, I am trying to flow text from one text frame to another. Because of the nature of the code, I must collect the text frame objects in one place, and "connect" them in another. Here is the code I use (Script Debugger) to collect the text frames for later linking:
global TextFlowList
on SetWhenBottom(CommandString)
set CSLength to length of CommandString
set TempTextFrameNum to characters 3 through CSLength of CommandString as string
tell application "InDesign 2.0.1"
tell active document
tell last page
-- I also ran without the "object reference" phrase -- didn't make a difference.
set CurrentTF to object reference of first text frame
set temprec to {TFFrame:CurrentTF, NextFrame:TempTextFrameNum}
set end of my TextFlowList to temprec
end tell
end tell
end tell
end SetWhenBottom
And here is where I actually link the text frames:
on SetTopTextFrame(CommandString)
local FirstLoopFlag
set FirstLoopFlag to false
tell application "InDesign 2.0.1"
tell active document
tell last page
repeat with i in TextFlowList
if FirstLoopFlag = false then
display dialog "Passing through the true branch of first loop test"
set FirstLoopFlag to true
set TempFrameHolder to TFFrame of i
else
--This is where it seems to crash...
set next text frame of TFFrame of item i to TempFrameHolder
display dialog "Passing through the else branch first loop test"
set TempFrameHolder to TFFrame of i
end if
end repeat
display dialog "after repeat loop"
set MyLastFrame to first text frame
tell MyLastFrame
set next text frame to TempFrameHolder
end tell
end tell
end tell
end tell
end SetTopTextFrame
The message I receive from InDesign is as follows:
"Assert 'i < flength in K2VectorBase.h at line 213 failed.
InDesign crashes immediately after acknowledgment of this message. Please note that I have placed a comment before the line I think is causing the crash.
Does anyone have any helpful advice as to what I am doing wrong? I have a feeling that it has something to do with how I am setting the "next text frame" property, but more than that, I cannot say.
TIA!
John
Technical Details
Message-ID:
<1de92180.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,90560ac96d9691c2,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-05-14 14:38:08 PST From: "John Darnell" <John.Darnell@Walsworth.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Assert error in InDesign when running script Message-ID: <1de92180.-1@WebX.la2eafNXanI> Date: Wed, 14 May 2003 14:13:49 -0700 Lines: 85 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit