Illustrator Paths : II

this is a continuation of a discussion started in Illustrator Paths : I, which covered two important facts about drawing vectors. this post will touch on how to anticipate the shape of a curve and drawing economically.

when drawing with the pen tool it can be handy to use a driving analogy — the direction you pull the control point equals the direction of the vehicle (that’s pretty obvious), the distance you pull that control point equals your speed. the three curves below use the same two anchor points and only one control point. the direction of travel is the same for all three, but the speed varies. the first is traveling faster and has to travel further before turning sharply to get to where it’s going. the last one is traveling slower, so can make a more gentle turn :
screen grab show three different curves
direction and speed — you are controlling only two things every time you pull out a control point. but what a lot of variation you can get between two anchors with just one control point :
screen grab of three more open curves
you might prefer the rubber band analogy — direction and stretch — same thing :
screen grab showing three more curves using only one control point

now, these are the simplest curves possible — two anchor points and one control point. but any one curve can have two control points — that’s two directions and two speeds interacting with each other — giving us quite complex curves from just two anchors :
complex curves from just two anchor points
join those two anchor points together and you get quite complex shapes :
screen grab showing complex shapes from just two anchor points

and that’s the main lesson for this post — you can get quite complex curves and shapes from very few anchor points. and fewer anchors generally means more beautiful curves.

macgrunt icon

Illustrator Paths : I

this is the first of a few posts dealing with drawing vectors in Adobe Creative Suite — which really isn’t as difficult as some appear to find it.

these posts are more about understanding the mechanics of vectors — for the very basics on drawing with the pen tool see Adobe’s site.

let’s start with some observations about curved paths : when you draw a circle with the ellipse tool (holding down shift constrains the dimensions to a circle) you get four anchor points. each anchor point has a pair of equi-distant control points :
screen capture of circle path

delete two of those points and you’ll get an ellipse with anchor points at either end. again the control points are equi-distant from their anchor points — that’s what makes the ellipse symmetrical. with a bit of experimenting you’ll find that you can make exactly the same shape with anchor points on either side instead. what does this show? … that there is generally more than one way to create any given curved shape (note: this is important fact number one).screen grab of elliptical pathscreen grab of second elliptical path

a seriously under-utilised feature of vectors in CS is that you are not restricted to just adjusting anchor and control points — you can also drag the path segments themselves. take that first ellipse and drag the sides out and you’ll find you can create a circle (maybe not exactly perfect, but so close to perfect that it doesn’t matter). this demonstrates important fact number two : any one anchor point can describe a curve up to 180 degrees :
screen grab of 2-point circular path

fully understanding the implications of these two important facts will lead to more efficient curve drawing (fewer anchor points equals more beautiful curves), and a greater love of vector drawing generally :
screen grab of heart shaped path

macgrunt icon

InDesign tip : #22

of course, you already use paragraph and character styles — and you know that anyone using InDesign and NOT using styles is a loony — but many people are still missing out on the full power of these features simply because they don’t know about nested styles.

nested styles allow you to quickly format a bunch of paragraphs that share the same character style overrides. this grab shows part of a page of text — the first paragraph shows how all the other paragraphs should look (click to enlarge) :
screen grab show page of text and first paragraph styled

for that first paragraph we have created a paragraph style (basic body) and two character styles (body bold and body oblique). now, you could format all the rest of the text by first styling it all to the paragraph style and then manually selecting the bits you want to be bold and oblique and applying the appropriate character styles — but that would be tedious.

for nested styles, once you have your para and chara styles set, you format ALL the text to just the para style (and apply the chara style ‘none’) :
screen grab showing all text styled to paragraph style only

… then you edit your paragraph style to set the nesting :
screen grab showing how to set the nested style

for this example we’re using a ‘line’ style — which applies the character style body oblique to the entire first line of each paragraph (there are soft returns after the dates in these paragraphs). and the other nested style applies the character style body bold to the first four words. and PRESTO! :
screen grab showing fully styled text for all text on page

… quicker than you can say “wow” the whole shebang is done. but there’s a little glitch — not all the bits of text that should be bold are four words long — dammit :
screen grab showing problem paragraph

it would be great if we could fix this by just setting the nested style to change at the em dash — but, unfortunately, that’s not possible just yet (maybe future versions). so we have to try another trick — the end nested style here character. for this example we’re placing the character just before the em dash. you do that by placing your cursor and right-clicking to bring up the contextual menu — then choose insert special character > other > end nested style here :
contextual menu showing where to find the end nested style here character

… then just use find/change to seek out all em dashes and replace them with the special character/em dash combo :
using find/change to place special character before em dashes

… then go back and edit the paragraph style. this time we need to set the first nested style to apply body bold up to first end nested style here character :
changing nested style to end at special character

sorted :
screen grab showing correctly styled text

now, after all that, just to reiterate THE most important piece of information in this post — if you’re not using paragraph and character styles, you’re probably a loony.

keep grunting

macgrunt icon

InDesign scripting : lesson 22

performing tedious, repetitive tasks — no matter how small — is monkey-work. automating those tasks makes you just that little bit less like a monkey. if you take a moment to think about it, you may find you’re wasting an awful lot of life on mundanities …

… such as creating and emailing proofs for clients. this script will export a pdf, attach it to an email, then add the recipient, subject line and basic message — all with just three double-clicks.

the first part of the script exports the pdf. exporting pdfs was covered way back in scripting lessons 08 thru 12, so refer back to them if you need an explanation of what’s going on here :

tell application "Adobe InDesign CS4"
  save active document
  set mgPdfPresets to name of every PDF export preset
  set mgPdfPreset to choose from list mgPdfPresets with prompt "How you want these done then?" with title "CHOOSE PDF EXPORT PRESET"
  if mgPdfPreset is false then
    display dialog "WHATEVER!" buttons "get stuffed" giving up after 1
    error number -128
  end if  
  set properties of PDF export preferences to properties of PDF export preset (item 1 of mgPdfPreset)
  set page range of PDF export preferences to all pages
  set mgFolder to file path of active document
  tell application "Finder"
    if (exists folder "PDF" of folder mgFolder) is false then
      make new folder at mgFolder with properties {name:"PDF"}
    end if
  end tell
  set mgDocName to name of active document
  set OrigDelims to text item delimiters of AppleScript
  set text item delimiters of AppleScript to {"."}
  set mgShortName to text item 1 of mgDocName
  set text item delimiters of AppleScript to OrigDelims
  set mgFilePath to mgFolder & "PDF" & ":" & mgShortName & ".pdf" as string
  tell active document
    export format PDF type to mgFilePath without showing options
  end tell
end tell

tell application "Finder"
  set mgFile to mgFilePath as alias
end tell

this uses the choose from list command which will present the user with a dialog listing their available export presets. it’ll look something like this :
screen grab of pdf export selection dialog

just for shits and giggles we’ve added a surly message for any user who dares to cancel that dialog instead of proceeding.

the last part of that script above gets a reference to the pdf as an alias — ready to attach to the email.

the next part of the script sets up the details for the email. this workflow has a small number of possible email recipients (just the four sales reps who deal directly with clients) — you might want to come up with a different solution if your list is longer :

set mgChoice to choose from list {"macGrunt", "macGroan", "macGrumble", "John"} with prompt "Who you want this sent to?"
if mgChoice is false then
  error number -128
end if
set mgChoice to item 1 of mgChoice
if mgChoice is "macGrunt" then
  set mgAddress to ""
else if mgChoice is "macGroan" then
  set mgAddress to ""
else if mgChoice is "macGrumble" then
  set mgAddress to ""
else if mgChoice is "John" then
  set mgAddress to ""
end if

set mgContent to "Hi " & mgChoice & return & return & "Here's your groovy proof" & return

first the user is asked to select from another list that might look something like this :
screen grab of email recipient dialog
then, based on that choice, the email address is set. finally verbage for the email content is set.

the last part of the script sets up the actual email and will need to change depending on which email software you are using. for example, this is how you could do it for Mail :

tell application "Mail"
  set mgMessage to make new outgoing message with properties {visible:true, subject:mgShortName, content:mgContent}
  tell mgMessage    
    make new to recipient with properties {name:mgChoice, address:mgAddress}
    tell content of mgMessage
      make new attachment with properties {file name:mgFile} at after last paragraph
    end tell
  end tell
  save mgMessage
  set visible of mgMessage to true
end tell

you’ll notice that, for this workflow, we’re using the shortened filename as our subject line.

this is how it would go if you needed to do the same thing with Outlook :

tell application "Microsoft Outlook"
  set mgMessage to make new outgoing message with properties {subject:mgShortName, content:mgContent}
  make new recipient at mgMessage with properties {email address:{name:mgChoice, address:mgAddress}}
  make new attachment at mgMessage with properties {file:mgFile}
  open mgMessage
end tell

you should be able to use these as a starting point — just open the relevant scripting dictionary in script editor to work out the syntax specific to your email software. if it all becomes too hard — google is your friend.

well, that’s it. a relatively small time-saving, but just think how many times you repeat that simple monkey-task every week.

macgrunt icon

InDesign tip : #21

screen grab showing page tool in tool panelof all the groovy features released with CS5, the most longed-for must be the ability to have different page sizes in the one document. now you can have a whole stationery set in one file, or do tricky things with book covers without lots of guides and measuring and whatnot. once you get started with the page tool — near the top of your tool panel — you’ll wonder how you ever did without it.

this tip will use a book cover with flaps as its example. the page tool is easy to use — just grab the tool and click on the page (or pages) you want to adjust. you’ll get familiar fields up in your control panel :
screen grab of control panel when page tool is selected

of course, if you’re smart (and you know you are), you’d do this with your master pages and then drag the masters down to make your spread. here’s the 300x200mm covers with a 100mm flap at each end :
screen grab of four page spread — covers and flaps

now (obviously) somewhere down the track the specs are going to change and you’ll need to add a 10mm spine to that cover. no worries, just make a 10mm wide page and drop it in … but what’s this? :
screen grab of margin warning dialog

buggeration! but don’t panic. all it means is that you can’t have, for example, 15mm margins on a 10mm page. just set margins and columns appropriate for that page and you’ll be cruising :
screen grab of cover spread with spine

ok, you got that sorted and now the client has come back with another change (don’t you just love your job?) — covers are now to be 250mm instead of 300mm. no worries just use the page tool to change your master and everything’s sweet … um … :
screen grab of messed up cover spread

now that’s annoying. and it gets even more annoying when you try to drag those little buggers back into a nice neat spread in you pages panel — go on, try it, dare you.

but don’t despair, because the fix is pretty easy. just grab your page tool again and shift-click to select all the pages in the spread. in the control panel check the use spacing box, set the spacing to 0mm and hit the horizontal spacing button :
screen grab of page alignment portion of the control panel

… and everything is hunky dory again :
screen grab of fixed spread

there may well be limits to page sizes but there seems to be no problem making pages 1x1mm — so now you can go ahead and make that nano-book you’ve always dreamed of (you know you want to). go sick.

macgrunt icon