Tips & Tricks Part 2: Add/Remove column

Discuss AppleScripting for QuarkXPress 2015, 2016 & 2017.

Tips & Tricks Part 2: Add/Remove column

Postby pjanssen » 30 Nov 2016, 08:38

I created some Applescripts, which might be useful for others too. So I wanted to share them here.

The second one is for adding or removing a column in a text box.

Adding a column:

Code: Select all
try
   tell application "QuarkXPress"
      tell document 1
         get properties of current box
         set SelectedBoxClass to (class of current box) as string
         if SelectedBoxClass is "TXTB" or SelectedBoxClass is "text box" then
            set SelectedBox to object reference of current box
            set SelectedBoxColumns to columns of current box
            if SelectedBoxColumns < 7 then
               set SelectedBoxColumns to SelectedBoxColumns + 1
            end if
            tell SelectedBox
               set columns to SelectedBoxColumns
            end tell
         end if
      end tell
   end tell
end try


Removing a column:

Code: Select all
try
   tell application "QuarkXPress"
      tell document 1
         get properties of current box
         set SelectedBoxClass to (class of current box) as text
         if SelectedBoxClass is "TXTB" or SelectedBoxClass is "text box" then
            set SelectedBox to object reference of current box
            set SelectedBoxColumns to columns of current box
            if SelectedBoxColumns > 1 then
               set SelectedBoxColumns to SelectedBoxColumns - 1
            end if
            tell SelectedBox
               set columns to SelectedBoxColumns
            end tell
         end if
      end tell
   end tell
end try


These scripts are especially useful if a keyboard shortcut is attached to them.

If you own Keyboard Maestro: more useful macros can be found here: http://forums.quark.com/viewtopic.php?f=17&t=28981
pjanssen
 
Posts: 125
Joined: 31 Dec 1969, 19:00

Return to QuarkXPress 20xx: Scripting

Who is online

Users browsing this forum: No registered users and 1 guest