How to apply "pure" Style Sheet to a paragraph?

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)

How to apply "pure" Style Sheet to a paragraph?

Postby Jean-Marie Schwartz » 20 Feb 2015, 06:37

Hi All! Everything's in the Subject.
If I simply set style sheet to "Normal" then some formattings are kept (the typical + sign aside the style sheet name in the palette). So I could set every properties to default but wondered if there is another way. For instance how to apply "no style" so I can apply "Normal" purely afterwards?
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2488
Joined: 23 Nov 2004, 04:30

Re: How to apply "pure" Style Sheet to a paragraph?

Postby medialog » 18 May 2015, 08:58

This has changed from version to version ( because of paragraph styles and character styles).

You can try this:
1) Make a new style for the selected paragraph (while it is selected)
2) Choose this style for the selected paragraph
3) Select the 'original' style

... or
1) Make a new style
2) Duplicate the original style
3) Delete the original style, replace it with 'the new'
4) Delete 'the new', replace it with 'the duplicated'

(and maybe rename the style sheet to its original name)
medialog
 
Posts: 6
Joined: 18 May 2015, 05:42

Re: How to apply "pure" Style Sheet to a paragraph?

Postby Jean-Marie Schwartz » 19 May 2015, 04:32

Thanks for your reply. Just wondered if you noticed the AppleScript forum we are in?
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2488
Joined: 23 Nov 2004, 04:30

Re: How to apply "pure" Style Sheet to a paragraph?

Postby medialog » 19 May 2015, 06:38

yes, you can do this by scripting (I don't have the syntax for style sheet.

Alternatively, you can try something like:
tell application "QuarkXPress"
activate
tell selection
set style of every word of every paragraph to {on styles:{bold}}
#set style of word 1 of every paragraph to {off styles:{italic, bold}}
# then do the the same with font, size, etc.
end tell
display dialog "done" with icon "100"
end tell
medialog
 
Posts: 6
Joined: 18 May 2015, 05:42

Re: How to apply "pure" Style Sheet to a paragraph?

Postby pjanssen » 20 May 2015, 05:07

Something like this:

Code: Select all
tell application "QuarkXPress"
   tell document 1
      tell story 1 of current box
         set style sheet of paragraph 1 to null
         set style sheet of paragraph 1 to "Normal"
      end tell
   end tell
end tell


Tested with QXP 9.5.4 on Mac 10.8.5
pjanssen
 
Posts: 125
Joined: 31 Dec 1969, 19:00

Re: How to apply "pure" Style Sheet to a paragraph?

Postby Jean-Marie Schwartz » 20 May 2015, 09:28

Oh great! I searched for the ID or wathever refering to "none" in the style sheets. Didn't think of using null. Thanks a bunch!
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2488
Joined: 23 Nov 2004, 04:30

Re: How to apply "pure" Style Sheet to a paragraph?

Postby pjanssen » 21 May 2015, 02:41

Found out by using the get properties syntax :)
pjanssen
 
Posts: 125
Joined: 31 Dec 1969, 19:00

Re: How to apply "pure" Style Sheet to a paragraph?

Postby Jean-Marie Schwartz » 21 May 2015, 03:40

Clever! :) I stopped at Get every style specs :roll:
Jean-Marie Schwartz

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.10.5 • QuarkXPress 9.5.4.1 + QuarkXPress 2017 • Adobe CS5 =
Jean-Marie Schwartz
 
Posts: 2488
Joined: 23 Nov 2004, 04:30


Return to QuarkXPress 8, 9 & 10: AppleScript

Who is online

Users browsing this forum: No registered users and 2 guests

cron