Need a Complicated Script for Quark 8.5 to Reference an Exte

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)
Post Reply
Lloyd Lathrop
Posts: 0
Joined: 16 Jan 2014, 18:17

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Lloyd Lathrop » 16 Jan 2014, 12:39

I'm running Quark 8.5 on a MacOS X 10.6.8. I need to change several thousand product SKU numbers in some of our catalogs. I have an Excel file with the old part numbers in one column and the corresponding new ones in a second column that correspond to the adjacent number in the first column.What I need the script to do is look in the Excel file, find the old part number in the first cell, look in the Quark file for that same number, change it to the new part number (which is in the second column in the Excel file), then repeat the process for each old/new part number. It would be beneficial if it could complete the entire section/Quark file in one operation, and even better if I could target a folder of files and have it convert all the numbers in all the files in that folder (but at this point I'd take one file at a time).The catalogs are set up so that the part number is the first text in the row, then there's a tab, then some descriptive text, then another tab, then the price (most of the listings are set-up this way, others are not). There could be one listing in a group or ten listings in a group, it's not consistent. The part numbers are almost all two digits, a hyphen, then five digits. If you need one of the files to see how the pages are constructed, let me know.I am totally ignorant when it comes to AppleScript (well, it's been years since I tried to write a script), so any help I could get would be greatly appreciated. Thank you to whoever can help me with this.Lloyd Lathrop

Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Emma » 16 Jan 2014, 21:24

I did something like this a long, long time ago. It's certainly possible. I'll see what I can dig out at home...

Lloyd Lathrop
Posts: 0
Joined: 16 Jan 2014, 18:17

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Lloyd Lathrop » 17 Jan 2014, 02:13

Thanks! My daughter's name is Emma. Beautiful name.

Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Emma » 17 Jan 2014, 02:20

It's a fine book too!
Don't hold your breath, I'm very out of practice with this now - don't use Quark at all any more.
You can tell Quark that 'words can begin and end with' only tabs, then you can address 'word 3' of a line, knowing that it will actually look at the third tab.
I'll find my script and see if it's going to be in any way useful...

Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Emma » 19 Jan 2014, 07:09

Unfortunately I can't find the script I wrote.

But it seems the first thing you need to be able to do is isolate the Part Number (i.e. column 1):

If you have columns of text, tabbed, and you want to look up the value of the 1st column, you need to be able to 'address' it.

If the part number includes a hyphen, say abc-123, and you tell Applescript to copy the first word, it will return 'abc' which isn't what you want.

So try this script (first select some type that starts with a part number)

tell application "QuarkXPress"
set delimit item "-" to can start or end or be contained in word
tell selection
set myWord to word 1
end tell
set delimit item "-" to can start or end word
end tell
myWord

The bottom part of the script window will now show the correct part number. In effect you have tricked Quark into thinking that a hyphen is part of a word.

If you can let me see how your files are set up I will try to help further... But there are others here (or were...) who are much better at this than me and may be more helpful!

Lloyd Lathrop
Posts: 0
Joined: 16 Jan 2014, 18:17

Need a Complicated Script for Quark 8.5 to Reference an Exte

Post by Lloyd Lathrop » 20 Jan 2014, 03:00

I have a Quark page and a PDF of the same page that I can send to you but I don't see an "attachment" button here. If you have some other way that I could send it I'd be glad to do it. Thanks!

Post Reply

Return to “QuarkXPress 8, 9 & 10: AppleScript”