🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17151

[AS] Am I triggering a known issue, or is this script just written incorrectly?

#17151
From: Eric McManus
Date: Thu, 26 Jun 2003 17:06
35 lines
2524 bytes
This morning, when I run this script I've been trying to develop, it shuts down InDesign every time. I have another script that was doing the same, but I found reference here to the problem (search/replace "^p^p" with "^p"). So, am I up against another known problem that all you old hands can tell me about, or do I need to do more troubleshooting (trash prefs, comment out various lines looking for the killer, etc.)?

tell application "InDesign 2.0.2" 
	set myDocument to active document 
	tell myDocument 
		set myIngredStyle to paragraph style "Ingredients" 
		set myParenStyle to character style "parenthetical" 
		repeat with j from 1 to (count stories) 
			tell story j 
				repeat with i from (count paragraphs) to 1 by -1 
					set myParaName to applied paragraph style of paragraph i of story j 
					if myParaName = myIngredStyle then 
						try 
							try 
								set myOpenParen to index of (character 1 whose contents = "(") of paragraph i 
							end try 
							try 
								set myCloseParen to index of (character 1 whose contents = ")") of paragraph i 
							end try 
						end try 
						try 
							set myOpenParen to index of (character 1 whose contents = "(") of selection 
							set myCloseParen to index of (character 1 whose contents = ")") of selection 
							set applied character style of characters myOpenParen thru myCloseParen to myParenStyle 
						end try 
					end if 
				end repeat 
			end tell 
		end repeat 
	end tell 
end tell



I was working on this script a couple of days ago (and receiving much help from Jay Fraser), but I set it aside yesterday. Unfortunately, I can't remember what sort of results I was getting last time I worked on it, or what changes I may have made since the last time it ran without crashing InDesign.
Technical Details
Message-ID: <1de9b237.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,fb399c6421d29800,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-06-26 10:10:08 PST
From: "Eric McManus" <emcmanus@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!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: [AS] Am I triggering a known issue, or is this script just written incorrectly?
Message-ID: <1de9b237.-1@WebX.la2eafNXanI>
Date: Thu, 26 Jun 2003 10:06:52 -0700
Lines: 47
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit