Article View: adobe.scripting.indesign
Article #16161Why does it crash on inserting images in table cells?
From: Richard_Ronnback
Date: Sat, 04 Oct 2003 18:57
Date: Sat, 04 Oct 2003 18:57
49 lines
2600 bytes
2600 bytes
I got a tab delimited text file with tre items on every row, two short texts and then a file path, like tihis:
text 1 text 2 "Macintosh HD:users:richardr:desktop.test.tif"
What I want to do is to place the textm convert it to a table, a extract the file path (as string) and place the image in the cell in which the path resides. It works as long as I have 4 or 5 rows, but when the numbers get greater InDesign crash every time and I can't figure out why.
Is it some limitaion to placing inline graphics in tables that does this, a bug, or what?
Any suggestions would be appreciated.
Here is the code
tell application "InDesign 2.0.2"
set myDoc to active document
set find preferences to nothing
set change preferences to nothing
set properties of display setting "optimized" to {raster:gray out, vector:gray out, transparency:off, antialiasing:true, greek below:80.0}
set view display setting of window 1 to optimized
tell myDoc
tell page 1
set myStory to place (choose file with prompt "pick a tab delimited file" of type {"TEXT"}) place point {12.7, 12.7}
end tell
save
tell myStory
make table
end tell
set myPaths to search myStory for "Macintosh HD"
repeat with myCounter from (count of items in myPaths) to 1 by -1
save
set myImageCell to parent of item myCounter of myPaths
set myFilePath to text contents of myImageCell as string
set text contents of myImageCell to ""
tell myImageCell
set auto grow of myImageCell to false
set clip content to cell to true
set myImage to place file myFilePath on insertion point 1 with properties {local display setting:optimized}
end tell
end repeat
end tell
set find preferences to nothing
set change preferences to nothing
end tell
Technical Details
Message-ID:
<2ccda933.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.tpinternet.pl!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,46bfdaacda47fa41,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-10-04 12:08:09 PST From: Richard_Ronnback@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Why does it crash on inserting images in table cells? Message-ID: <2ccda933.-1@webx.la2eafNXanI> Date: Sat, 4 Oct 2003 11:57:18 -0700 Lines: 57 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit