RE: Quark syntax for creating a new paragraph with text
RE: Quark syntax for creating a new paragraph with text
- Subject: RE: Quark syntax for creating a new paragraph with text
- From: Frank Miedreich <email@hidden>
- Date: Wed, 10 Jul 2002 12:00:48 +0200
Hi,
to make a new paragraph with some text in it you can use:
make paragraph at end with data someText
or, of course:
make paragraph at end with data someText with properties someProps
I am using this in my own scripts, and it seems more straightforward
than the other solution.
cheers, Frank
At 17:13 Uhr -0400 09.07.2002, Wadson, David wrote:
Your understanding was correct but I was trying to "make" a new paragraph
instead of copying text to after the last paragraph. My second mistake with
fumbling was missing that I needed to add a carriage return after each item.
I can easily strip out the extra return that the last iteration of the loop
adds.
I was tempted to convert the list to a return-delimited string but as each
paragraph is placed I needed to do some further editing of it based upon the
contents. Rather than have multiple loops I just wanted the one.
Using "make new paragraph" made a paragraph but also putsthe text "word"
into it which I would then have to replace with my text, hence my code:
set newParagraph to make new paragraph at end
set (every text of story 1 where it is "word") to currentParagraphContents
Now easily replaced with:
copy (currentParagraphContents & return) to after last paragraph
A simple routine later on in the script strips out the extra return that I
end up with after the very last paragraph is put in the box.
----------
From: Hans Haesler
Sent: Tuesday, July 9, 2002 4:30 PM
To: AS lists
Subject: Re: Quark syntax for creating a new paragraph with text
I don't quite understand your scheme. Do you loop through the list and
insert -- somehow -- one paragraph after the other? Then you could use:
---
tell document 1 of application "QuarkXPress 4.11"
tell text box "textBoxName"
copy currentParagraphContents to after last paragraph
end tell
end tell
---
'currentParagraphContents' consists of the current item of the list
and an appended return.
A faster solution: convert the list to a return-delimited string and
set the story to it, e.g.:
---
<snip>
---
> Hans Haesler <email@hidden>
--
Dr. Frank Miedreich
Leiter Entwicklung/IT
Kochan & Partner GmbH
Hirschgartenallee 25, 80639 M|nchen
Tel.: +49 89 17860-930, Fax: +49 89 1781235
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.