• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Working with Quark6 Text and Special Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working with Quark6 Text and Special Characters


  • Subject: Re: Working with Quark6 Text and Special Characters
  • From: Luca Pozzato <email@hidden>
  • Date: Thu, 14 Oct 2004 14:25:12 +0200

Title: Re: Working with Quark6 Text and Special Characters
Hi Jason,

May be you can solve the problem just referring to paragraphs of vSelection  instead of paragraphs of vEveryText like in the following example

Just create a new document with a text box with 3 columns and some text in each one

tell application "QuarkXPress Passport 4.11"
   tell document 1
       set vEveryText to every text of text box 1 -- text box 1  
is your "vSelection"
       set vStoryCount to count of vEveryText
       set vParaCount to count of paragraphs of vEveryText
       set vParaCount_2 to count of paragraphs of text box 1 -- text box 1  
is your "vSelection"
   end tell
   return {vParaCount, vParaCount_2,vEveryText}
end tell

vEveryText from the result should contains also the  new column character identify within xpress as "\c"

ciao
Luca
------
From: Jason Bourque <email@hidden>
Date: Wed, 13 Oct 2004 16:08:15 -0400
To: Applescript <email@hidden>
Subject: Working with Quark6 Text and Special Characters


Hello,

I have a script that goes through each paragraph and formats pricing in a catalog.

I works great, superscripts the dollar symbol and bolds the price and skips standard pricing when sale pricing applies.

Well a few text box have multiple columns and I use the enter key to force the text to the next column. When the script runs across this character it
doesn¹t count it as a paragraph so the paragraph count fails one behind and formats the paragraph before the one it should.

If I remove the character and just add some returns it works fine. Any advise on working with this character?

Thanks,

Jason Bourque


tell application "QuarkXPress 6"
   activate
   tell document 1
       if not (exists current box) or box type of current box is not text box type then error "A single text box must be selected."
       
       set vSelection to current box
       
       tell vSelection
           try
               set vEveryText to every text
               tell story 1
                   try
                       set style of every character where it is "$" to plain
                       set style of every character where it is "$" to superior
                   end try
                   try
                       set style of every character where it is "¢" to plain
                       set style of every character where it is "¢" to superior
                   end try
               end tell
           on error
               set vEveryText to ""
           end try
       end tell
       
       -- return result
       
       set vStoryCount to count of vEveryText


       set vParaCount to count of paragraphs of vEveryText
       set vParaStyleNames to name of paragraph style of every paragraph of story 1 of vSelection
       -- return {vParaCount, vParaStyleNames}
       set vPriceFlag to false
       
       set vBoldOffset to 0
       
       repeat with vNth1 from 1 to vParaCount
           set vParaNth to paragraph vNth1 of vEveryText
           set vParaStyleNth to item vNth1 of vParaStyleNames
           
           if (vNth1 is not vParaCount) and ¬
               (((paragraph (vNth1 + 1) of vEveryText) starts with "Sale Price") or ¬
                   ((paragraph (vNth1 + 1) of vEveryText) starts with "Discount Price") or ¬
                   (vParaNth contains "Reg. Price")) then
               set vSalePriceFlag to true
           else
               set vSalePriceFlag to false
           end if
           
           
           if (vParaStyleNth begins with "Price Line") and (vSalePriceFlag is false) and (vParaNth does not contain "Reg. Price") then
               
               if (vParaNth starts with "Sale") or (vParaNth contains "Sale") or (vParaNth starts with "Discount") then
                   copy {true, 1} to {vPriceFlag, vStartBoldNum}
               else
                   copy {0, 0} to {vStartBoldNum, vEndBoldNum}
               end if
               
               if vParaNth contains "¢" then
                   set vCentFlag to true
               else
                   set vCentFlag to false
               end if
               
               
               set vParaTextCount to count of vParaNth
               repeat with vNth2 from 1 to vParaTextCount
                   set vCharacterNth2 to character vNth2 of vParaNth
                   
                   tell vSelection
                       tell story 1 of vSelection
                           
                           if (vCharacterNth2 is "$") then
                               copy {true, vNth2} to {vPriceFlag, vStartBoldNum}
                           end if
                           
                           if (vCharacterNth2 is tab) then
                               if vCentFlag then
                                   copy {true, vNth2 + 1} to {vPriceFlag, vStartBoldNum}
                               else if vPriceFlag then
                                   copy {false, 1} to {vPriceFlag, vBoldOffset}
                               end if
                           end if
                           
                           if ((vPriceFlag is false) or (vNth2 is vParaTextCount)) and vStartBoldNum is not 0 then
                               copy (vNth2 - vBoldOffset) to vEndBoldNum
                               set style of characters vStartBoldNum thru vEndBoldNum of paragraph vNth1 to {on styles:{bold}}
                               -- Reset Variables
                               copy {0, 0, 0} to {vStartBoldNum, vEndBoldNum, vBoldOffset}
                           end if
                       end tell
                   end tell
                   
               end repeat
               
               set vPriceFlag to false
               
           end if
       end repeat
   end tell
end
tell


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Working with Quark6 Text and Special Characters (From: Jason Bourque <email@hidden>)

  • Prev by Date: Re: [Admin] Re: HELP - unsubscribe
  • Next by Date: Re: [Admin] Re: HELP - unsubscribe
  • Previous by thread: Working with Quark6 Text and Special Characters
  • Next by thread: Re: This is ridiculous
  • Index(es):
    • Date
    • Thread