Re: Quark Paragraph Numbers and other QuarkNewbie Questions
Re: Quark Paragraph Numbers and other QuarkNewbie Questions
- Subject: Re: Quark Paragraph Numbers and other QuarkNewbie Questions
- From: Xandra Lee <email@hidden>
- Date: Sun, 19 Nov 2000 18:28:31 -0500
Thanks to Hans & Jason,
Had finished the intended script prior to later posts based on the
initial suggestion of using:
"copy var to front of every..." syntax.
It basically bypassed the problem I was having: Attempting to retain a
reference to the paragraph numbers, once the text became deselected.
I really appreciate the snippet on using object reference to paragraphs
-- as I forsee many scripts which will require this. Your snippet worked
liked a charm, but I'm still curious if there's any way to return a
reference to the paragraph number, rather than "text from char 111 to
whatever..."
My interest here is two-fold: Firstly, to allow for sloppy selections,
(which may actually be handled by QXP.) But also, since the number of
characters will likely change in many cases, I'd like to avoid
calculating these changes within by merely referring to the selection as
paragraphs 2 thru 4.... IS it possible in Quark to get a reference to the
paragraph numbers of a selection?
I've included the final script below in case someone following this
thread wants a basic but flexible, bullet list creation script. Sorry if
my initial snippet failed, I'd try to remove irrelevant sections of a
working script -- won't try that one again.
Thanks,
xandra
---------------SCRIPT TEXT-------------
--Note following doesn't error check for selection nor will it
--inform user if styleSheet name doesn't exist
-- adds desired bullet character to selected paragraphs
-- optionally will change font & size of the bullet
property bulletChar : "" --(spade in symbol font (ASCII 170)
property changeFont : true
property bulletFont : "Symbol"
property reduceFontSize : true
property reduceBy : 2
property bulletStyleName : "BulletList"
tell application "QuarkXPress"
try --in case style sheet doesn't exist:
set style sheet of every paragraph of the selection to bulletStyleName
on error
end try
--add bulletChar and tab before each selected paragraph:
set prepend to (bulletChar & tab)
copy prepend to front of every paragraph of the selection
--Following COULD alternately be done using QXP's Find replace:
--change Font & size of the bullet if desired:
if changeFont is true then
set font of ((first character of every paragraph) of the selection) to
bulletFont
end if
if reduceFontSize is true then
set oldSize to size of (first character of the selection)
my reduceSize(oldSize, reduceBy)
set newSize to the result
set size of ((first character of every paragraph) of the selection) to
newSize
end if
end tell
--following necessary cause QXP returns size
-- as "10 pt" a string with a non-break space and "pt"
on reduceSize(oldSize, reduceBy)
set z to (oldSize as text)
set x to ((text 1 thru -4) of z) --remove "opt-space pt"
--first convert to number :
set N to x as number
set N to (N - reduceBy)
--reassemble using opt-space (ascii 202)
set newSize to ((N as text) & " pt") as string --that's an option space
return newSize
end reduceSize
Alixandra Leigh
AceDesign
email@hidden
------------------------------------------
Furniture:
><
http://home.rochester.rr.com/alexleighs/furniture/furniture.htm>
Renderings:
><
http://home.rochester.rr.com/alexleighs/interiors/interiors.htm>