Author Topic: [SOLVED] applying tab settings separately from style sheets  (Read 2441 times)

0 Members and 1 Guest are viewing this topic.

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
[SOLVED] applying tab settings separately from style sheets
« on: November 15, 2010, 01:06:57 PM »
I work on a lot of financial documents, and I'm noticing a recurring "problem"

In a given table, lets say I have 12 different paragraph stylesheets.

The tab settings vary according to the length of dollar amounts in each column.
My question: should I create different versions of each of my 12 stylesheets, to match each different tab configuration?

The number of stylesheets will skyrocket... and be daunting.

It doesn't seem like having different stylshts everytime is NOT the correct way to go.
What about having a script that would apply tab settings, regardless of what that particular paragraph's stylesheet is?
Like
     repeat with x from 1 to x
          set tab list of paragraph (para_start + x) to list_of_tab
     end repeat
 
I would keep a list of different tab sets (list_of_tab)... but that's the basic idea.
What do you think of the approach?

Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: applying tab settings separately from style sheets
« Reply #1 on: November 15, 2010, 02:54:15 PM »
I am puzzled here, if you could setup your stylesheets with AS as you described than why could you not set your tabs correctly to begin with?

Could you supply an example of the columns you are attempting to align?

Another thing you might have overlooked is that you can base style sheet on another one. In this case you would only need to change the tabs definitions in the "master" style and have them propagated through the other ones.

HTH
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: applying tab settings separately from style sheets
« Reply #2 on: November 15, 2010, 09:48:29 PM »
The problem is that, within the various paragraphs that use, say "stylesheet X", there will be a number of different tab variances.

No matter what particular tab set I give stylesheet X, there will be numerous places throughout the document where paragraphs (with stylesheet X) will need different tab configurations.

Other than the tab differences, those paragraphs are identical.
So it seems simpler to not create a separate stylesheet for every different tab arrangement.

But maybe I'm wrong... That's why I threw the question out there.


Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: applying tab settings separately from style sheets
« Reply #3 on: November 16, 2010, 08:28:40 AM »
So your intent is to apply LOCAL FORMATTING to your paragraph... How will AppleScript know which paragraph to act upon? Current Selection?
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: applying tab settings separately from style sheets
« Reply #4 on: November 16, 2010, 08:31:49 AM »
That's it. Sorry for not being clear.

It could be selection, or story. I'm more interested in the ability ("science?") of manipulating tab sets independent of stylesheets.

« Last Edit: November 16, 2010, 09:03:21 AM by AutoFetishist »

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: applying tab settings separately from style sheets
« Reply #5 on: November 16, 2010, 08:33:45 AM »
Just wondering if anyone else has ever done this, or what they think of the approach.


Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: applying tab settings separately from style sheets
« Reply #6 on: November 16, 2010, 10:23:08 AM »
The following works for me in both Quark 7 and Quark 8:
Quote
001     property tabSets : {}

002     tell application "QuarkXPress"
003          activate
004          set docName to name of document 1
005          tell document docName
006               set tabSets to {
007                    {setID:1, tabSet:{
008                         {justification:left justified, position:100},
009                         {justification:left justified, position:200},
010                         {justification:left justified, position:300},
011                         {justification:left justified, position:400}
012                              }
013                         },
014                    {setID:2, tabSet:{
015                         {justification:left justified, position:120},
016                         {justification:left justified, position:220},
017                         {justification:left justified, position:320},
018                         {justification:left justified, position:420}
019                              }
020                         },
021                    {setID:3, tabSet:{
022                         {justification:left justified, position:140},
023                         {justification:left justified, position:240},
024                         {justification:left justified, position:340},
025                         {justification:left justified, position:440}
026                              }
027                         }
028                         }
029               set tabChoices to {}
030               repeat with thisSet in tabSets
031                    set end of tabChoices to setID of thisSet
032               end repeat
033               set tabSetChoice to choose from list tabChoices without multiple selections allowed and empty selection allowed
034               tell selection
035                    try
036                         set tab list of every paragraph to tabSet of item (tabSetChoice as integer) of tabSets
037                    end try
038               end tell
039          end tell
040     end tell
Notes:
The line numbers included with this script are there to aid future discussions. In order to use this script, you will have to strip them all from the code.


HTH
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: applying tab settings separately from style sheets
« Reply #7 on: November 16, 2010, 10:25:53 AM »
Super.

How do you like 8, btw?

Offline Publi-Script

  • Administrator
  • Hero Member
  • *****
  • Posts: 596
  • Karma: 16
  • Gender: Male
  • Automate your Life!
    • Publi-Script.com
Re: applying tab settings separately from style sheets
« Reply #8 on: November 16, 2010, 11:08:00 AM »
Super.

How do you like 8, btw?

I haven't used it enough to forge a solid opinion yet...
Michel Lemieux
Forum Administrator
-------------------------
OS X 10.6.4
Quark 6.5 / 7.5 / 8.1.6
Adobe Design Premium CS / CS2 / CS3 / CS4 / CS5
Script Debugger 4.5

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: applying tab settings separately from style sheets
« Reply #9 on: November 16, 2010, 11:51:15 AM »
"Seems" a lot more polished.
Maybe "they" finally are waking up.