Find numbering format in Quarkxpress 6.5

Hi,

I have a task to find the number and delete it in Quarkxpress 6.5.

The number is in following format:

Chapter 1, Chapter 2, Chapter 3 …
Chapter I, Chapter II, Chapter III …
Chapter One, Chapter Two, Chapter Three, …
Chapter one, Chapter two, Chapter three, …

I want to find these format in quark document and delete it.

Can any one give me a suggestion how to do this in Quark 6.5 using applescript.

Thanks,
Gopal

Can I get any help for the above question.

Thanks,
Gopal

Hi,

what do you want to delete? The Paragraph Styles you listed?

Hans

Hi Hans,

I want to delete the text in the quark document not the paragraph styles.

For example, if the text in a quark document reads:

See chapter 1 for further example,…

or

See chapter one for understanding …

I want to delete the text “chapter 1” and “chapter one” both lines.

Is it possible to do this using pattern search in applescript.

Thanks,
Gopal

Try this:

set tid to AppleScript's text item delimiters


tell application "QuarkXPress Passport"
	tell front document
		repeat with i from 1 to count of text boxes
			my dotheSearch(i)
		end repeat
	end tell
end tell

set AppleScript's text item delimiters to tid

on dotheSearch(theTxtBoxNbr)
	set delList to {"Chapter 1", "Chapter I", "Chapter one"} --and so on ..., you've got to fill the list ;-)
	
	tell application "QuarkXPress Passport"
		tell front document
			set theStory to story 1 of text box theTxtBoxNbr
			
			repeat with a from 1 to count of delList
				
				if theStory contains item a of delList then
					
					set AppleScript's text item delimiters to (item a of delList)
					set theStoryList to every text item of theStory
					set theCount to (count every word of item 1 of theStoryList) + 1
					delete words theCount thru (theCount + 1) of story 1 of text box theTxtBoxNbr
					
					set AppleScript's text item delimiters to "  "
					set theStory to story 1 of text box theTxtBoxNbr
					set theStoryList to every text item of theStory
					set theCount to (count every character of item 1 of theStoryList) + 1
					delete character theCount of story 1 of text box theTxtBoxNbr
					
					set AppleScript's text item delimiters to (item a of delList)
					set theStory to story 1 of text box theTxtBoxNbr
					set theStoryList to every text item of theStory
					if (count of theStoryList) > 1 then my dotheSearch(theTxtBoxNbr)
					
				end if
				
			end repeat
			
		end tell
	end tell
end dotheSearch


without any guaranty :wink:

Hi Hans,

Thanks for your timely help and suggession.

Thanks,
Gopal