Article View: adobe.scripting.indesign
Article #216Re: paragraph styles in javascript
From: adMjb
Date: Fri, 01 May 2009 13:28
Date: Fri, 01 May 2009 13:28
36 lines
2415 bytes
2415 bytes
I am looking for this but in javascript so I can run it on a PC, I
know nothing of java and would love any help. Many thanks
on run {input, parameters}
set DeleteList to {"Heading 1 NoNumber", "Heading 1", "Heading 2",
"Heading 3", "Heading 4"}
set ReplaceList to {"00 - Chapter Title", "00 - Chapter Title
Numbered", "01 - A Heads", "02 - B Heads", "02 - C Heads"}
tell application "Adobe InDesign CS4"
activate
tell document 1
set MyStories to every story
repeat with StoryCount from 1 to (count of MyStories)
tell (item StoryCount of MyStories)
repeat with CurrentParagraph from 1 to count of paragraphs
set ParStyle to name of applied paragraph style of paragraph
CurrentParagraph
if DeleteList contains ParStyle then
repeat with x from 1 to count of DeleteList
if item x of DeleteList is ParStyle then
set applied paragraph style of paragraph CurrentParagraph to
item x of ReplaceList
end if
end repeat
end if
end repeat
end tell
end repeat
end tell
end tell
return input
end run
Technical Details
Message-ID:
<5412320e-d931-4f3c-b0aa-db6c36b5a98d@z23g2000prd.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!z23g2000prd.googlegroups.com!not-for-mailReferences:
<33909f94-3411-4f5d-b199-cf17c5b5019e@r31g2000prh.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: a938ebf930,6b07c0def62c81fb X-Google-Attributes: gida938ebf930,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!z23g2000prd.googlegroups.com!not-for-mail From: adMjb <adam.mjbarnes@gmail.com> Newsgroups: adobe.scripting.indesign Subject: Re: paragraph styles in javascript Date: Fri, 1 May 2009 06:28:42 -0700 (PDT) Organization: http://groups.google.com Lines: 36 Message-ID: <5412320e-d931-4f3c-b0aa-db6c36b5a98d@z23g2000prd.googlegroups.com> References: <33909f94-3411-4f5d-b199-cf17c5b5019e@r31g2000prh.googlegroups.com> NNTP-Posting-Host: 82.69.71.210 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1241184523 1305 127.0.0.1 (1 May 2009 13:28:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 1 May 2009 13:28:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z23g2000prd.googlegroups.com; posting-host=82.69.71.210; posting-account=zbwvkAoAAABO9xNJnEt9uR3D3zaFhIe0 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16,gzip(gfe),gzip(gfe)