🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20553

Re: AS: converting text to tables

#20553
From: Dave Saunders
Date: Tue, 25 Jun 2002 14:37
27 lines
1573 bytes
You're close but (with help from ole), I used this: 

tell application "InDesign 2.0.1" 
�set mySelection to selection 
�set myItem to object reference of item 1 of mySelection 
�if class of myItem is character then 
��tell myItem 
���set myTable to make table 
��end tell 
�else 
��-- error; do whatever you need to do 
�end if 
end tell 

Quite why the class is returned as "character" in this case is beyond me but it apparently is. It might also work to eliminate that test and use a try, like this: 

try 
�tell myItem 
��set myTable to make table 
�end tell 
on error 
�-- take error action 
end try 

This would handle any case where (for whatever reason) myItem had some other legitimate text class while still erroriing any other kind of selection. 

Dave
Technical Details
Message-ID: <ef94f76.0@WebX.aaQKaf7vad4>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!netaxs.com!newsread.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <ef94f76.-1@WebX.aaQKaf7vad4>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,c768981cc104491c
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-06-25 07:38:30 PST
From: "Dave Saunders" <daves@pdsassoc.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!netaxs.com!newsread.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: AS: converting text to tables
Message-ID: <ef94f76.0@WebX.aaQKaf7vad4>
Date: Tue, 25 Jun 2002 07:37:13 -0700
References: <ef94f76.-1@WebX.aaQKaf7vad4>
Lines: 31
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit