Author Topic: Box overflow  (Read 3424 times)

0 Members and 1 Guest are viewing this topic.

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Box overflow
« on: March 05, 2012, 07:53:00 AM »
I use this code
         set boxList to object reference of every text box of every page whose box overflows is true

to alert the user before printing that a box exists with the overset indicator.

What I'm finding is that about 2/3 of the time the flagged boxes don't actually have any "real" text, maybe just a stray ¶ or →

I'm curious what anyone else would do to tell the script to ignore such instances (to me, they are harmless, not worth worrying about).

And too many false positives will defeat the purpose of having the script run.
(I'm already getting complaints from co-workers  ;)

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: Box overflow
« Reply #1 on: March 05, 2012, 08:00:29 AM »
So what? You’d like not to take into account boxes whose overflow is let’s say empty? Can’t you elaborate a list of everything that is not really text overflow (such as empty paragraph returns and so on) and just tell in the script if the overflowing text is in the list, just skip the alert? Don’t know if I’m clear.
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: Box overflow
« Reply #2 on: March 05, 2012, 03:03:44 PM »
I understand your thought, but not sure how to code it.

How would one reference the text which has "overflown"?

Once I've done that, would I simply state

      if the number of characters in x (the overflow) is greater than 0, then...

or did you mean to approach it a diff. way?


Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: Box overflow
« Reply #3 on: March 06, 2012, 03:29:30 AM »
Oh! sorry! Since I’ve never worked with text overflow I thought it was possible and easy to know what was overflowing…
So what you could do is to check box overflows and when a box does overflow check the last char: if it’s a carriage return or a tab or whatever would be assimilated to an empty char, just delete it and loop till the last char is not in the list you’ve set. Does it make sense?
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: Box overflow
« Reply #4 on: March 06, 2012, 07:12:27 AM »
Aha.

This will be trickier then. Because for QXP, overflow is a property of text boxes, not stories.

Here's my full script:

set theSound to file ":Users:mainuser:Library:Sounds:copcar.wav" as alias


tell application "Play Sound"
     activate
end tell

tell application "QuarkXPress"
     tell document 1
          try
               set boxList to object reference of every text box of every page whose box overflows is true
          on error
               set boxList to {}
          end try
          if boxList's length > 0 then
               select (first item of boxList)
               show selection
               tell application "Play Sound"
                    play theSound
               end tell
          else
               display dialog "You're Clean, Baby"
          end if
     end tell
end tell


So, in the line

               select (first item of boxList)

I will need to have QX refer to the last character of that first item's story, right?

Because characters are not properties of text boxes... or are they?

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: Box overflow
« Reply #5 on: March 06, 2012, 07:29:31 AM »
I guess looping through boxes in the list, you’ll have to address the story 1 each time and check wether the last char is a paragraph return or whatever and delete it if not necessary (so this is another repeat loop inside of the first one), sth like if last character of story 1 of text box i is return then delete last character of story 1 of text box i (repeat while last character is not a full stop or any punctuation sign that might end a paragraph). I don’t think it’s a big deal when story 1 must be invoked instead of the text box itself. What’s more complicate is when you must target the container. At least to me…
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline cdms

  • Full Member
  • ***
  • Posts: 111
  • Karma: 6
  • Gender: Male
Re: Box overflow
« Reply #6 on: March 08, 2012, 03:10:00 AM »
It may be easier to have two loops;

1. every story and tidy up the end as JMS suggests.
2. every overflow and check as you are currently

This should be easier than trying to do it nested.

Offline Nerek

  • Visitor
  • Posts: 1
  • Karma: 0
Re: Box overflow
« Reply #7 on: April 23, 2013, 08:30:07 AM »
Nice script, i use it to control before printing.
I tried to adapt it to control overflow on table box but it seems that this property is usable only with text box. Any idea ?

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: Box overflow
« Reply #8 on: April 23, 2013, 09:18:26 AM »
Have you tried targetting text cells?
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline AutoFetishist

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: 2
  • Gender: Male
Re: Box overflow
« Reply #9 on: April 23, 2013, 11:00:36 AM »
Hello every-body

No, I remember wanting to, but it seemed table cells were their own animal.