Page 2 of 2

I need to change the first sentence to bold

Posted: 12 May 2014, 05:48
by mark lane
I tried to reply a couple of time but it was blocked, may because of the word knife. There is a tab before Retail. I could have 20 - 30 paragraphs

BV116 Long. 28" overall. 8" black finish stainless extra thick with 5". Black rubberized grip. Bulk packed. Retail $1,44.95
BV132 Mini Covert. 2 1/4" closed framelock. 1 3/8" black finish stainless assisted opening tanto with extended tang. Black aluminum handles. Lanyard hole. Black stainless pocket clip with slot cutout design. Retail $11.95


Thanks

I need to change the first sentence to bold

Posted: 12 May 2014, 22:31
by Jean-Marie Schwartz
OK so the word Retail is always present in the paragraph and there is always a tab before it, right? Is there any tab elsewhere?

I need to change the first sentence to bold

Posted: 13 May 2014, 07:39
by mark lane
No, just one tab before Retail.

I need to change the first sentence to bold

Posted: 14 May 2014, 04:08
by Jean-Marie Schwartz
Then try this:
tell application "QuarkXPress"
tell document 1
tell current box
repeat with P from (count of paragraphs) to 1 by -1
[b]if paragraph P [b]contains "." [b]then
[b]tell paragraph P
[b]set font [b]of (characters -1 [b]thru ([b]first character [b]where [b]it [b]istab)) [b]to "Optima LT Std Bold"
[b]end [b]tell
[b]end [b]if
[b]end [b]repeat
[b]end [b]tell
[b]end [b]tell
[b]end [b]tell

I need to change the first sentence to bold

Posted: 14 May 2014, 04:09
by Jean-Marie Schwartz
Post pending moderation :-/Be patient!

I need to change the first sentence to bold

Posted: 30 May 2014, 03:01
by mark lane
For some reason no matter where I put the
set font of (characters -1 thru (first character where it is tab)) to "Optima LT Std Bold"
it says, error "Cant get every -1 from character 1 of paragraph 26 of current box of document 1 of application \"QuarkXPress\" to it whose it = \" \" of character." number -1728
It looks like it would work great, but I keep getting this error.
Thanks

I need to change the first sentence to bold

Posted: 01 Jun 2014, 21:15
by Jean-Marie Schwartz
Sorry! Just wrap that line (leaving it where I put it) in a try block (so add a line try before and end try after). HTH.

I need to change the first sentence to bold

Posted: 02 Jun 2014, 04:14
by mark lane
Thanks, I had a problem using the where it is tab, when I changed to where it is " " it didn't error and worked.

Thanks

I need to change the first sentence to bold

Posted: 02 Jun 2014, 04:39
by Jean-Marie Schwartz
Great! Indeed it depends on the versions of both applications and OS. Glad it's sorted out!