book mockup imposition

if you still get confused when working out which page goes next to which when you’re creating a book mockup or dummy, this post is for you — all you need is grade 3 maths ability.

we’ll use a 16pp book as our example. the front and back covers are pages 1 and 16 — add those two numbers and you’ll get 17. the inside covers are pages 2 and 15 — add them together and you’ll get 17. see a pattern here?

it’s the same for any book — take the total number of pages and add 1 — that’s the magic number your imposed spreads should add up to. page 6 of a 16pp book will be next to page 11, page 13 will be next to page 4, etc.

the only other thing you need to worry about is which page goes on which side of the imposed spread. again, it’s just a matter a grade 3 maths — even numbered pages are always on the left.

showing page imposition for 16 page book

macgrunt icon

Advertisements

upgrade or go to hell

it looks like Adobe are giving their customers the finger — with a recently announced change to their upgrade policy :
“With regards to upgrades, we are changing our policy for perpetual license customers. In order to qualify for upgrade pricing when CS6 releases, customers will need to be on the latest version of our software (either CS5 or CS5.5 editions). If our customers are not yet on those versions, we’re offering a 20% discount through December 31, 2011 which will qualify them for upgrade pricing when we release CS6.”

you can read the full post here : Adobe Creative Cloud and Adobe Creative Suite: New Choices for Customers.

this announcement was made only a month ago — giving users a very small window of opportunity if, indeed, they hear about the change at all.

photoshop guru, Scott Kelby, has published a very polite plea in An Open Letter To Adobe Systems.

let’s hope Adobe are sensible enough to heed the voice of reason.

macgrunt icon

GUI scripting : acrobat

some applications have poor scripting support — acrobat is a shocker. have a look at the acrobat scripting dictionary to see just how restricted the opportunities are — even for the pro version. but it IS still possible to automate acrobat through GUI (graphical user interface, or gooey) scripting. GUI scripting has been available since OSX 10.3 (panther) and uses system events to, basically, activate menus, open windows and click buttons in the same way that you would using a mouse.

this post will outline a process for working out just one example — running a batch sequence from the advanced menu. but hopefully you’ll glean enough information to be able to adapt what’s here for other scripts too.

first you need to enable GUI scripting. you can do this through the applescript utility found in applications > applescript :

screen grab of applescript utility showing gooey scripting enabled

with GUI scripting, rather than telling an application to do something (eg. tell application “Adobe Acrobat Pro”), you tell system events to tell the application to do something. system events refers to applications as processes. make sure acrobat is running and then run this in script editor (also found in applications > applescript) :

tell application "System Events"
  get name of every process
end tell

you’ll get a list of names in the results window — some of which you may not recognise. this is where you find out that system events refers to ‘adobe acrobat pro’ as, simply, ‘acrobat’. so you would address acrobat like this :

tell application "System Events"
  tell process "Acrobat"
    -- do something --
  end tell
end tell

the first thing you’ll want to address is the menu bar at the top of the screen — acrobat, file, edit, view, etc. the following script shows that, to access a menu, you need to first address the associated menu item. weird eh? :

tell application "System Events"
  tell process "Acrobat"
    tell menu bar 1
      tell menu bar item "Advanced"
        tell menu "Advanced"
          tell menu item "Document processing"
            tell menu "Document processing"
              click menu item "Batch Processing..."
            end tell
          end tell
        end tell
      end tell
    end tell
  end tell
end tell

pretty straightforward so far? ok. now, the above script will open the ‘batch sequences’ window :

screen grab of batch sequences window

with this example we want to run the optimise sequence — so we need to select the sequence and then click the run sequence button. and this is where things REALLY get confusing. exactly how do we find the terminolgy to address the right bits? we ask for the window’s UI elements :

tell application "System Events"
  tell menu bar 1 of process "Acrobat"
    tell menu "Advanced" of menu bar item "Advanced"
      tell menu "Document Processing" of menu item "Document Processing"
        click menu item "Batch Processing..."
      end tell
    end tell
  end tell
  tell window "Batch Sequences" of process "Acrobat"
    return UI elements
  end tell
end tell

two things to notice here : first, the number of lines has been reduced by combining sets of two (eg. tell menu bar 1 of process “Acrobat”); second, when a new window is opened you need to go right back to system events to address that window (you can’t just continue on from after “click menu item “Batch Processing…””). the above script will give you something like this in script editor’s results window :
screen grab of UI elements of batch sequences window

a whole bunch of buttons — most of them are listed by name (that makes it easy to find the run sequence button) but what about those first three? buttons 1, 2, & 3 are the red, yellow and green lights you get at the top of every window these days. the only other UI elements are some static text (the window’s title) and a scroll area — ahh, that sounds right, the list of sequences are within something that might be called a scroll area… ok, how do we find out how to talk to the scroll area? we ask for its UI elements :

tell application "System Events"
  tell menu bar 1 of process "Acrobat"
    tell menu "Advanced" of menu bar item "Advanced"
      tell menu "Document Processing" of menu item "Document Processing"
        click menu item "Batch Processing..."
      end tell
    end tell
  end tell
  tell window "Batch Sequences" of process "Acrobat"
    tell scroll area 1
      return UI elements
    end tell
  end tell
end tell

… and here are the results :
screen grab of UI elements of scroll area 1

only two UI elements for the scroll area — one is a scroll bar (probably not what we’re looking for) and the other is an outline. outline? WTF? oh well, let’s keep going, see what we find (we’re actually nearly there) :

tell application "System Events"
  tell menu bar 1 of process "Acrobat"
    tell menu "Advanced" of menu bar item "Advanced"
      tell menu "Document Processing" of menu item "Document Processing"
        click menu item "Batch Processing..."
      end tell
    end tell
  end tell
  tell window "Batch Sequences" of process "Acrobat"
    tell outline 1 of scroll area 1
      return UI elements
    end tell
  end tell
end tell

… gives us this :
screen grab of UI elements of outline 1

ooh… that looks like something we can work with. let’s try it :

tell application "System Events"
  tell menu bar 1 of process "Acrobat"
    tell menu "Advanced" of menu bar item "Advanced"
      tell menu "Document Processing" of menu item "Document Processing"
        click menu item "Batch Processing..."
      end tell
    end tell
  end tell
  tell window "Batch Sequences" of process "Acrobat"
    tell outline 1 of scroll area 1
      select row 4
    end tell
    click button "Run Sequence"
  end tell
end tell

bingo! first we have to open the batch sequences window, then select row 4 of outline 1 of scroll area 1, then click the run sequence button. phew!

now you can see why GUI scripting is only used as a last resort. there are third party products which make it easy to drill down through the various UI elements. and apple provide a free accessibility inspector with its developer tools or the, also free, UI elements inspector.

but why do things the easy way when you can have sooo much fun working it out the hard way?

macgrunt icon