🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8598

Re: Apple Script to Count Text Lines?

#8598
From: Shane_Stanley
Date: Wed, 11 Oct 2006 23:44
24 lines
1783 bytes
This is some basic code that will calculate what you want:

tell application "Adobe InDesign CS2"
    set theLines to lines of parent story of selection
end tell
set allCounts to {}
set theCounter to 1
repeat with i from 1 to count of items of theLines
    if item i of theLines = return as string then
        if theCounter > 1 then
            set end of allCounts to (theCounter - 1)
        end if
        set theCounter to 1
    else
        set theCounter to theCounter + 1
    end if
end repeat
if theCounter > 1 then
    set end of allCounts to (theCounter - 1)
end if
return allCounts

-- 
Shane Stanley <sstanley@myriad-com.com.au>
Technical Details
Message-ID: <C153BF02.312C3%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing
References: <3bc1eeaf.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,9768b27e6c138761
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Shane_Stanley@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: Apple Script to Count Text Lines?
Message-ID: <C153BF02.312C3%sstanley@myriad-com.com.au>
Date: Wed, 11 Oct 2006 16:44:34 -0700
References: <3bc1eeaf.-1@webcrossing.la2eafNXanI>
Lines: 26
Received: from bld-mail02.adl2.internode.on.net [203.16.214.66] by adobeforums.com; Wed, 11 Oct 2006 16:44:38 -0700
Received: from [192.168.1.2] (unverified [59.167.75.174])  by mail.internode.on.net (SurgeMail 3.2f) with ESMTP id 241184010  for <adobe.scripting.indesign@adobeforums.com>; Thu, 12 Oct 2006 09:14:37 +0930 (CST)
Return-Path: <sstanley@myriad-com.com.au>
User-Agent: Microsoft-Entourage/11.2.5.060620
Thread-Topic: Apple Script to Count Text Lines?
Thread-Index: AcbtjzRJcyIsqlmCEduWAgARJHm3nA==
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing