Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

print non continuous pages

Hi,


I would like to print a selection of pages, ie 3,6,8,9,10.


In word on my pc this was easy but I don't seem to be able to do this in Pages on my mac. I am running Mac OS x 10.7.3 and the latest version of Pages.


Any help grateflly received.


Many Thanks

Sharon

MacBook Pro, Mac OS X (10.7.2), 2.3GHz i5

Posted on Apr 9, 2012 2:43 AM

Reply
Question marked as Best reply

Posted on Apr 9, 2012 8:35 AM

I guess that you know that Windows is not OS X so there is no reason to assume that they must behave the same way.

iWork applications (and I assume that it's the same for other applications using the Apple drivers) allow us to print every pages of a given document or to define one range of pages.

What you describe is not one range, it's a list of several ranges. There is no provision for that.

If you are not satisfied by this feature,

go to "Provide Pages Feedback" in the "Pages" menu , describe what you wish.

Then, cross your fingers, and wait at least for iWork'12 ;-)


I'm thinking to a possible workaround.

Print the entire document in a PDF.

Open the PDF in Preview

In this app, you may select the pages to print before calling the Print feature.

The process is well described in the Preview Help.

With my very old scholar English, I'm unable to describe this process more efficiently.


Yvan KOENIG (VALLAURIS, France) lundi 9 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

6 replies
Question marked as Best reply

Apr 9, 2012 8:35 AM in response to Tudor68

I guess that you know that Windows is not OS X so there is no reason to assume that they must behave the same way.

iWork applications (and I assume that it's the same for other applications using the Apple drivers) allow us to print every pages of a given document or to define one range of pages.

What you describe is not one range, it's a list of several ranges. There is no provision for that.

If you are not satisfied by this feature,

go to "Provide Pages Feedback" in the "Pages" menu , describe what you wish.

Then, cross your fingers, and wait at least for iWork'12 ;-)


I'm thinking to a possible workaround.

Print the entire document in a PDF.

Open the PDF in Preview

In this app, you may select the pages to print before calling the Print feature.

The process is well described in the Preview Help.

With my very old scholar English, I'm unable to describe this process more efficiently.


Yvan KOENIG (VALLAURIS, France) lundi 9 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Apr 9, 2012 10:43 AM in response to KOENIG Yvan

Hello


Here is a script allowing to print a selected list of pages.

Select the document

Run the script

In the dialog, type the list of page numbers to print separated by comma.

Click OK (or press Return)


--{code}

--[SCRIPT]

(*

Yvan KOENIG (VALLAURIS, France)

2012/04/9

*)


on run

try

display dialog "Type a list of pages numbers to print separated by comma." default answer "2,4"

on error

return

end try


text returned of result

my supprime(result, space)

set listePages to my decoupe(result, ",")


tell application "Pages" to tell document 1

set dName to its name

end tell


repeat with num in listePages

my imprimePage("Pages", dName, num as text)


delay 2

end repeat

end run


--=====


on imprimePage(theApp, wName, nPage)


activateapplicationtheApp

tell application "System Events" to tell application process theApp


keystroke "p" using {command down}

tell window wName

repeat

delay 0.1

if exists sheet 1 then exit repeat

end repeat

tell sheet 1

set {w, h} to size

if w < h then clickbutton -1 -- switch to expanded dialog


clickradio button 2 of last radio group

set value of text field 1 to nPage

set value of text field 2 to nPage

end tell -- sheet

end tell -- window


keystrokereturn

end tell -- System Events…

end imprimePage


--=====


on decoupe(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to oTIDs

return l

end decoupe


--=====

(*

removes every occurences of d in text t

*)

on supprime(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to ""

set t to l as text

set AppleScript's text item delimiters to oTIDs

return t

end supprime


--=====

--[/SCRIPT]

--{code}


I'm interested to know the way you select several sheets or ranges of pages under Windows.


Yvan KOENIG (VALLAURIS, France) lundi 9 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Apr 10, 2012 2:26 AM in response to KOENIG Yvan

(1) I apologize for the wrong word used in my late question.

I was supposed to type « tables » but I typed « sheets » 👿


(2) I decided to enhance the script so that we may also define ranges of pages.

I use the colon (:) which is already used in Numbers as range delimiter.

Typing "2,5:8" would print page 2 then pages 5 thru 8.

To allow you to change the delimiter if you dislike my choice, I defined it in a property « rangeDelimiter » so it would be easy to use an other one.


--{code}

--[SCRIPT]

(*

Yvan KOENIG (VALLAURIS, France)

2012/04/09

2012/04/10 added support of ranges

*)

property rangeDelimiter : ":"

(*

I don't know which one is used under Windows so I use the one used in Numbers ranges (B3:C12)

*)

--=====

on run

try

display dialog "Type a list of pages numbers to print separated by comma." default answer "2,5" & rangeDelimiter & "8"

on error

return

end try


text returned of result

my supprime(result, space)

set listePages to my decoupe(result, ",")


tell application "Pages"

set dName to name of document 1

end tell


my selectMenu("Pages", 9, dName) (* Bring the upper Pages document to front *)

error number -128

repeat with num in listePages

set num to num as text

if num contains rangeDelimiter then

my decoupe(num, rangeDelimiter)

set {num1, num2} to items 1 thru 2 of result

my imprimePage("Pages", dName, num1, num2)

else

my imprimePage("Pages", dName, num, num)

end if


delay 2

end repeat

end run


--=====


on decoupe(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to oTIDs

return l

end decoupe


--=====

(*

removes every occurences of d in text t

*)

on supprime(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to ""

set t to l as text

set AppleScript's text item delimiters to oTIDs

return t

end supprime


--=====


on activateGUIscripting()


(* to be sure than GUI scripting will be active *)

tell application "System Events"

if not (UI elements enabled) then set (UI elements enabled) to true

end tell

end activateGUIscripting


--=====

(*

my selectMenu("Pages",5, 12)

==== Uses GUIscripting ====

*)

on selectMenu(theApp, mt, mi)


activateapplicationtheApp

tell application "System Events" to tell application process theApp to tell menu bar 1 to ¬

tell menu bar itemmt to tell menu 1 to clickmenu itemmi


end selectMenu


--=====


on imprimePage(theApp, wName, fPage, lPage)


activateapplicationtheApp

tell application "System Events" to tell application process theApp


keystroke "p" using {command down}

tell window wName

repeat

if exists sheet 1 then exit repeat

delay 0.1

end repeat

tell sheet 1

set {w, h} to size

if w < h then clickbutton -1 -- switch to expanded dialog


clickradio button 2 of last radio group

set value of text field 1 to fPage

set value of text field 2 to lPage

end tell -- sheet

end tell -- window


keystrokereturn

end tell -- System Events…

end imprimePage


--=====

--[/SCRIPT]

--{code}


Yvan KOENIG (VALLAURIS, France) mardi 10 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Apr 10, 2012 2:28 AM in response to KOENIG Yvan

Hi,


Thanks for your reply, I'm afraid I don't know how to run a script.


I should have been clearer when I said windows, I mean in Word and I have checked with Word for Mac and it can do it too. In the print dialogue box User uploaded file

there is a box called page range and there you cane select pages to print that are not sequential just seperated by a comma. It's useful if you are printing four pages on one piece of paper.


Pages as you say does not offer this option.


I would be grateful if you could tell me how to run your script.


Many Thanks

Apr 10, 2012 2:56 AM in response to Tudor68

Word added extraneous features to the print driver.


I posted the bare script trying to help you quickly.

I didn't took time to write the intro which describe the way to use most of my scripts.


Here is a draft :


--{code}

--[SCRIPT print given pages]

(*

Enregistrer le script en tant que Script : print given pages.scpt

déplacer le fichier ainsi créé dans le dossier

<VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Pages:

Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.


Sélectionner le document Pages à imprimer

Aller au menu Scripts , choisir Pages puis choisir “print given pages”

Tapez la liste des pages à imprimer dand le dialogue ad'hoc.

2,5:8 imprimera la page 2 puis les pages 5 à 8.


--=====


L’aide du Finder explique:

L’Utilitaire AppleScript permet d’activer le Menu des scripts :

Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.

Cochez la case “Afficher le menu des scripts dans la barre de menus”.

Sous 10.6.x,

aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript

puis cocher la case “Afficher le menu des scripts dans la barre des menus”.


--=====


Save the script as a Script: print given pages.scpt


Move the newly created file into the folder:

<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:

Maybe you would have to create the folder Pages and even the folder Applications by yourself.


Select the Pages document to print

Go to the Scripts Menu, choose Pages, then choose “print given pages”

A dialog will ask you to type the list of pages to print

2,5:8 would print page 2 then pages 5 thru 8


--=====


The Finder’s Help explains:

To make the Script menu appear:

Open the AppleScript utility located in Applications/AppleScript.

Select the “Show Script Menu in menu bar” checkbox.

Under 10.6.x,

go to the General panel of AppleScript Editor’s Preferences dialog box

and check the “Show Script menu in menu bar” option.


--=====


Yvan KOENIG (VALLAURIS, France)

2012/04/09

2012/04/10 added support of ranges

*)

--=====

--{code}


Yvan KOENIG (VALLAURIS, France) mardi 10 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Apr 10, 2012 3:42 AM in response to KOENIG Yvan

As I forgot to delete an instruction useful only for some tests, I post now the script with the explanations and the code required to use French or English message.


--{code}

--[SCRIPT print sparse pages]

(*

Enregistrer le script en tant que Script : print sparse pages.scpt

déplacer le fichier ainsi créé dans le dossier

<VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Pages:

Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.


Sélectionner le document Pages à imprimer

Aller au menu Scripts , choisir Pages puis choisir “print sparse pages”

Tapez la liste des pages à imprimer dand le dialogue ad'hoc.

2,5:8 imprimera la page 2 puis les pages 5 à 8.


--=====


L’aide du Finder explique:

L’Utilitaire AppleScript permet d’activer le Menu des scripts :

Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.

Cochez la case “Afficher le menu des scripts dans la barre de menus”.

Sous 10.6.x,

aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript

puis cocher la case “Afficher le menu des scripts dans la barre des menus”.


--=====


Save the script as a Script: print sparse pages.scpt


Move the newly created file into the folder:

<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:

Maybe you would have to create the folder Pages and even the folder Applications by yourself.


Select the Pages document to print

Go to the Scripts Menu, choose Pages, then choose “print sparse pages”

A dialog will ask you to type the list of pages to print

2,5:8 would print page 2 then pages 5 thru 8


--=====


The Finder’s Help explains:

To make the Script menu appear:

Open the AppleScript utility located in Applications/AppleScript.

Select the “Show Script Menu in menu bar” checkbox.

Under 10.6.x,

go to the General panel of AppleScript Editor’s Preferences dialog box

and check the “Show Script menu in menu bar” option.


--=====


Yvan KOENIG (VALLAURIS, France)

2012/04/09

2012/04/10 added support of ranges

*)

--=====


property rangeDelimiter : ":"

(*

I don't know which one is used under Windows so I use the one used in Numbers ranges (B3:C12)

*)

--=====

on run

my activateGUIscripting()

try

if my parleAnglais() then

display dialog "Type a list of pages numbers to print separated by comma." default answer "2,5" & rangeDelimiter & "8"

else

display dialog "Saisir la liste des numéros de pages à imprimer (séparés par des virgules)." default answer "2,5" & rangeDelimiter & "8"

end if

on error

return

end try


text returned of result

my supprime(result, space)

set listePages to my decoupe(result, ",")


tell application "Pages"

set dName to name of document 1

end tell


my selectMenu("Pages", 9, dName) (* Bring the upper Pages document to front *)


repeat with num in listePages

set num to num as text

if num contains rangeDelimiter then

my decoupe(num, rangeDelimiter)

set {num1, num2} to items 1 thru 2 of result

my imprimePage("Pages", dName, num1, num2)

else

my imprimePage("Pages", dName, num, num)

end if


delay 2

end repeat

end run


--=====


on decoupe(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to oTIDs

return l

end decoupe


--=====

(*

removes every occurences of d in text t

*)

on supprime(t, d)

local oTIDs, l

set oTIDs to AppleScript's text item delimiters

set AppleScript's text item delimiters to d

set l to text items of t

set AppleScript's text item delimiters to ""

set t to l as text

set AppleScript's text item delimiters to oTIDs

return t

end supprime


--=====


on parleAnglais()

local z

try

tell application "Pages" to set z to localized string "Cancel"

on error

set z to "Cancel"

end try

return (z is not "Annuler")

end parleAnglais


--=====


on activateGUIscripting()


(* to be sure than GUI scripting will be active *)

tell application "System Events"

if not (UI elements enabled) then set (UI elements enabled) to true

end tell

end activateGUIscripting


--=====

(*

my selectMenu("Pages",5, 12)

==== Uses GUIscripting ====

*)

on selectMenu(theApp, mt, mi)


activateapplicationtheApp

tell application "System Events" to tell application process theApp to tell menu bar 1 to ¬

tell menu bar itemmt to tell menu 1 to clickmenu itemmi


end selectMenu


--=====


on imprimePage(theApp, wName, fPage, lPage)


activateapplicationtheApp

tell application "System Events" to tell application process theApp


keystroke "p" using {command down}

tell window wName

repeat

delay 0.1

if exists sheet 1 then exit repeat

end repeat

tell sheet 1

set {w, h} to size

if w < h then clickbutton -1 -- switch to expanded dialog


clickradio button 2 of last radio group

set value of text field 1 to fPage

set value of text field 2 to lPage

end tell -- sheet

end tell -- window


keystrokereturn

end tell -- System Events…

end imprimePage


--=====

--[/SCRIPT]

--{code}


Oops, I never took care to the fact that lines of code starting with a command specific to GUIscripting are wrongly indented by the messages parser 😟


Yvan KOENIG (VALLAURIS, France) mardi 10 avril 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

print non continuous pages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.