Scripting Quark 6 Index Xtension

I need to find text set to strikethrough and add it to the Quark Index. Seems the Index xtension has no AS functionality, so have to do it through UI Browser. Can’t get the button to push to insert into Index. Anyone else done this?

It’s not by making an index, but the result can be the same I think.

You can try to search for strikethrough and set this text to a character stylesheet (let’s call it IndexWord). Then you create a list (Edit > Lists) from this stylesheet. Make a new textbox and you will be able to build the list (index). (Window > show lists > Update > build).

Thanks for the response.

That’s an interesting solution, but I don’t think will work in this case. I need an index that can cope with names which aren’t always quoted in full in the book, so each entry needs to be examined once included in the index.

Seems like some buttons in QuarkXpress 6.1 do not react to the UI scripts. I tried it with “click at”, “Perform Action” and “Click” in the “Import Kerning Table” windows. The button flashes, but XPress does not do anything.

Anyone know of a way to force XPress to respond to UI clicks?

John

We call it bugs, Quark calls it “Normal behaviour”.

If you have to deal more with this stuff, I recommend Scripting QuarkXpress from Shirley Hopkins. Included with the book is a cd with ready to use scripts. One of them compares a textfile (with the entries which have to be in the index) with the Quarkdocument and then creates a complete index. (eg. Entry A. 12,45,65 etc). It’s slow but it works (best at night).

Yes, I’ve got Shirley’s book and was aware of her method. Ir was, in fact, the first place I looked for help. But it still means creating a text file with the index words in first.

I’m having a play with QuicKeys to see if I can get what I need with a mixture of the two (QuicKeys and AppleScript).

(Can’t help you with concrete scriptinglines now, because I don’t have a Mac or scriptcodes here. Vacation.)

But why not combine the two things you have? Let the script search for text set to strikethrough and add this text with the page number to the list made.
Or are there more levels in the index you want to make?

I’ve had a thought for doing this in Word. find the highlighted text, then cut it, paste within the necessary xpress tags. Import into Quark, export as xtags and then reimport. This might be nonsense, but would achieve what I’m after if it works. I’ll report back later in the week.

If you go to the scriptbuilders section of this site and go to the QuarkXpress-part of it, you will find a script I wrote called RTF to QuarkXTags 2.0. This might be helpful to you to search certain text and add XTags. It works in TexEdit, not with Word.
TeXEdit you’ll find here: http://www.malcolmadams.com/te/.

I have found a crude way of doing this by running two macros in word and importing, exporting and importing into Quark.

Here’s a brief explanation. The following macro is run in Word. It assumes you are at the start of the document. It searches for all text set to strikethrough. It then cuts it, enters parts of the xtags code for indexing and pastes again, writing in the rest of the code:
Sub Quark_Index_Entry()
IndexLoop:
Selection.Find.ClearFormatting
With Selection.Find.Font
.StrikeThrough = True
.DoubleStrikeThrough = False
End With
With Selection.Find
.Text = “”
.Replacement.Text = “”
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then Selection.Copy: Selection.Cut: Selection.TypeText Text:=“”: Selection.Paste: Selection.TypeText Text:=“<XC,”“”: Selection.Paste: Selection.TypeText Text:=“”“,”“”“,”“”“,”“”“,0,0,”“”“>”: GoTo IndexLoop
End Sub

Save and import into Quark. The Quark filter will treat the codes as ordinary text. Save the text as an xtags files. Open in Word and run this macro:

Sub Quark_Index_Entry_2()

’ Macro1 Macro
’ Macro recorded 15/7/2004 by Dr Digby L. James

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = “<<>”
.Replacement.Text = “<”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = “<>>”
.Replacement.Text = “>”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

This trims out the xtag code that tells Quark to ignore the xtags code I had previously inserted. Import into the Quark document WITH THE INDEX WINDOW OPEN. It doesn’t seem to work otherwise.

Lo and behold, a crude index. It still needs tidying, as George Whitefield needs to be changed to Whitefield, George, etc., etc., but it has saved a huge amount of effort.

Pity I couldn’t find an Applescript method.

And those who are experts at scripting, I apologise if you’ve spilt you coffee over you keyboards as you collapsed with paroxysms of laughter at how appalling my code is. I don’t care. It works. And if you think you can improve it, please share it with me.

Thanks to everyone who commented and gave me useful ideas.