Split a text flow into separate boxes

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)
Post Reply
Emma
Posts: 657
Joined: 07 Jul 2004, 08:43

Split a text flow into separate boxes

Post by Emma » 08 May 2013, 22:55

I have a galley of formatted text. It is copy for a catalogue, perhaps 10-12 items. Each item starts with a 9 point key number (1, 2, 3...) followed by a line of product name, a paragraph of description, and 1 or more lines of products codes, e.g.

2 Colour Television
This television does blah blah and blah.
1234 20inch 100
2345 24inch 200

I simply want each product in a separate text box. I've got as far as

set keynosref to object reference of every word where its size is "9 pt"

and somehow want to access the copy from the 9pt character through to the character before the next 9pt character, copy and paste it into a new box.

I need to use Quark copy and paste to preserve formatting. Or do I need to do the 'export with styles, import with styles' thing? It's so long since I've done anything like this and I have forgotten it all!

Any pointers appreciated!

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Split a text flow into separate boxes

Post by Jean-Marie Schwartz » 09 May 2013, 05:12

Hi Emma! I'm not totally with you. 1st of all, do you really need to use AS? The "new" Linker utility would do it for you I think. 2nd, I don't understand Oh! wait a minute! All the articles paras are running (I thought they'd be in linked boxes) and you'd want to split them all into seperate boxes, right? If so, Linker won't do that. Sorry. So if you wish to retain text settings, you have 2 possible routes to go to what I think: copy/paste inside of Quark or export text with XPress tags, split the text and reimport the bits. I'm not at ease at all with the latter.
As for selecting the articles (from one char to another), you'd better get the offset of the 9pt numbers and take the pportion from one to another (from end to beginning). Are you with me?

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

Split a text flow into separate boxes

Post by Emma » 09 May 2013, 05:24

The files are supplied by the customer, 60 odd. Our artworker has to get all the text into the artwork file and is using separate boxes (it's dotted around the page. So she asked me if I could split each item into a separate text box so she can just drag them across.
I'd forgotten about offset - won't be back on the job till tomorrow, but guess I just get 'offset of item 1 list'? My worry is still that if I tell Quark to copy and paste it seems to lose formatting. Unfortunately the text has XCatalog links so I'll have to strip them out (we're not using them) before I can export with tags.
Will look again tomorrow, hope brain comes back.

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Split a text flow into separate boxes

Post by Jean-Marie Schwartz » 09 May 2013, 06:55

My thought was rather to get the offset of every character whose size is "9pt" and then loop into the list of the result in reverse. Don't know if I'll be able to test on my side for I'm off till Monday. I'll read you tomorrow though. Hope your brain comes back :-D

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Split a text flow into separate boxes

Post by Jean-Marie Schwartz » 14 May 2013, 03:36

Hi Emma! Is everything OK with you? Did you manage to code the thing?

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

Split a text flow into separate boxes

Post by Emma » 14 May 2013, 03:39

Not entirely ok no! My employer has called in Administrators, which basically means they have 2 weeks to restructure and sell it or wind it up.
5 people made redundant yesterday. So scripting will have to wait. No idea if this job will even go ahead now. It's all a bit rubbish.

formerly Tony P
Posts: 103
Joined: 22 Dec 2008, 12:26

Split a text flow into separate boxes

Post by formerly Tony P » 15 May 2013, 01:11

Very sorry to hear that, Emma.
I've seen similar situations first-hand and know how unsettling and dis-spiriting they can be. Hope things work out ok for you, one way or another.

Post Reply

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