Changing default printer in Pages

When I first began printing in Pages, I was using a Canon printer. Now most of my printing is done at work on an HP Laserjet. Yet EVERY time I try to print, the printer Pages chooses is the OLD one and I have to manually change the choice of printer. If I am in a hurry and try to print a document and don't stop and change the printer (every time!) then Pages sends the document off to an old printer that is not even connected to my machine.

(1) Why doesn't Pages use the last printer used, like most other applications?

(2) How can I change this "default" setting? (I've looked everywhere ... in Preferences, Page Setup in the Inspector, etc., etc.

Ken

macbook 2.4 Ghz Intel Core 2 Duo, Mac OS X (10.5.4)

Posted on Jan 27, 2010 6:07 AM

Reply
38 replies

Oct 9, 2010 6:19 AM in response to semblant

I can't live with this bug. We have four printers here and each job may well be allocated to a different sort of printer; Photo, Inkjet Business, Wax sublimation or laser. It is ridiculous that Apple has not fixed this very basic bug, that seems to go back over two years, from tracking old posts. I am afraid it is back to Word for me. I just hope the printing of complicated forms from W2011 is better than W2008, where the print reformats itself from the screen to the printer and yes, I am aware that Microsoft is going to rip me off on the pricing of the business editions of Office 2011 for multiple machines.

Wilson

Oct 9, 2010 10:10 AM in response to WilsonLaidlaw

Here is a shell script which removes the printer information from the Pages document. This way Pages offers the default printer.
Also, AppleScript code is provided, so you can remove the printer information from the Pages document easily via the (right-click) context menu in Finder.

The resulting file (<filename>.noprinter.pages) may be slightly larger since the original internal file is preserved in the new Pages document (which is technically a ZIP-file).

Of course, there is no warranty or liability according to sections 15 and 16 and their interpretation in section 17 of the current GNU General Public License: http://www.gnu.org/licenses/gpl-3.0-standalone.html

The original shell script is taken from here: http://www.macosxhints.ch/index.php?page=2&hintid=2511
In order to get it work with Mac OS X 10.6.4 with Pages '09 version 4.0.4 I changed the calls of "mktemp", also I added a command to remove the temporary directory finally.

To do the whole thing via the (right-click) context menu in Finder, run "Automator" and click "New Service", then choose "Run AppleScript" from the Library.
An instruction for an older version of Mac OS, to some extent similar, is provided here: http://www.faqintosh.com/risorse/en/guides/as/guide/findermenu/

Apple Magic



Shell script:


#!/usr/bin/env bash
PROG_NAME="$(basename "${0}")"
PROG_DIR="$(cd "$(dirname "${0}")" && pwd)"
XSLT="$(cat <<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sl="http://developer.apple.com/namespaces/sl">
<xsl:template match="sl:NSPrinter" />
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
EOF
)"
for i in unzip xsltproc zip ; do
if ! which >/dev/null "${i}" ; then
echo 1>&2 "${PROG_NAME}: missing ${i}"
exit 1
fi
done
if [ "${#}" -eq 0 ] ; then
echo "usage: ${PROG_NAME} [PAGES_FILE...]"
exit
fi
basewd="${PWD}"
for i in ${1+"${@}"} ; do
echo -n "working on ${i}..."
idir="$(cd "$(dirname "${i}")" && pwd)"
ibase="$(basename "${i}")"
if [ -d "${i}" ] ; then
inplace=1
else
inplace=''
fi
if [ -z "${inplace}" ] ; then
# Changed
iwdir="$(mktemp -d /tmp/${PROG_NAME}.XXXXXX)"
unzip -d "${iwdir}" -q "${i}"
else
iwdir="${i}"
gunzip > "${iwdir}/index.xml" -c "${iwdir}/index.xml.gz"
fi
echo "${XSLT}"
| xsltproc >"${iwdir}/index.xml.tmp" - "${iwdir}/index.xml"
if [ -z "${inplace}" ] ; then
# Changed
iorig="$(TMPDIR= mktemp -d "${iwdir}"/index.xml.orig.XXXXXX)"
cp -Rfp "${iwdir}/index.xml" "${iorig}"
cat "${iwdir}/index.xml.tmp" >"${iwdir}/index.xml"
else
# Changed
iorig="$(TMPDIR= mktemp -d "${iwdir}"/index.xml.gz.orig.XXXXXX)"
cp -Rfp "${iwdir}/index.xml.gz" "${iorig}"
gzip >"${iwdir}/index.xml.gz" -c "${iwdir}/index.xml.tmp"
fi
rm -f "${iwdir}/index.xml.tmp"
if [ -z "${inplace}" ] ; then
inew="${idir}/${ibase%.*}.noprinter.${ibase##*.}"
cd "${iwdir}"
zip -9qry "${inew}" .
cd "${basewd}"
# Added
rm -rf "${iwdir}"
fi
echo done
done




AppleScript code for integration into the Finder context menu:


on run {input, parameters}

repeat with theItem in input
do shell script "~/bin/rm_pages_sticky_printer_mac_os_10.6.4_pages_09_ver_4.0.4.sh " & quoted form of POSIX path of theItem
end repeat

return input
end run

Oct 9, 2010 3:49 PM in response to WilsonLaidlaw

Of course one might wish that Pages allows the user to prefer the system default printer instead of some unchangeable printer information in the Pages document. Since I am not a developer of Pages, the only thing I can do is to supply this program that installs the utility as a service available via the (right-click) context menu in Finder:
http://rapidshare.com/files/424112418/RemovePages_stickyprinter.zip (53 KB)
It installs the service "Remove Pages sticky printer" and registers it at the operating system by simply calling "/System/Library/CoreServices/pbs" after installation which re-scans all services available. However, sometimes it takes a while until Mac OS has taken notice of it and offers the service in the context menu. The service is installed in Library/Services of the user home directory (no root/administrator privileges are required) - you may adapt it to older Mac OS versions by editing it with Automator or manually or simply delete it there if it is not required anymore. I have tested it successfully on Macs with the Mac OS and Pages version mentioned above.

Apple Magic




MD5 (Remove Pages sticky printer.zip) = 9aac7cbac630a471cb30f59388bccaf4

Oct 9, 2010 11:49 PM in response to Apple Magic

Apple Magic,

Again, many thanks for posting that download link. I have installed the file and restarted my MacBook Pro (using Pages 08) but when I right click on a Pages document, nothing is appearing in "Services" other than what was there before, most of which are file actions relating to my virus checker, intego Virus Barrier or Graphics Convertor actions. Any further suggestions? Do I have to run the automater script in some way?

Wilson

Oct 10, 2010 9:33 AM in response to KOENIG Yvan

I knew that I might need to play with the script to get it to work with Pages 08 but at the moment, the service is not even appearing amongst the other services, when I right click on a pages file in finder. I don't think there is any difference in the actual file structure between an 08 and 09 file, so it should not be able to detect it at the offered services stage.

Wilson

Oct 10, 2010 9:54 AM in response to WilsonLaidlaw

The structure of documents is different between iWork '08 and iWork '09.
This is why Pages '08 is unable to open Pages '09 documents !

Under 10.6.x, services aren't installed globally as under 10.5.x
They must be installed for the applications supposed to use them.
This scheme was built to give us a cleaner Services menu.

Yvan KOENIG (VALLAURIS, France) dimanche 10 octobre 2010 18:54:05

Oct 10, 2010 11:18 AM in response to fruhulda

fruhulda wrote:
Yvan, are these lasts post about Apple Magics Remove Pages sticky printer.Service or is it about the earlier script?
The service work fine on Snow leopard and Pages08



Glad to read that it works with Pages '08 documents but the shell piece of code embedded in the Service is the one posted here before. It's described with the same words. So, it seems that
(1) the author is really playing safe
(2) the asker made something wrong when he installed the beast or tried to use it.

I didn't installed it because, as I wrote, I don't want to use Automator which is an awful slow-downer.

Yvan KOENIG (VALLAURIS, France) dimanche 10 octobre 2010 20:18:02

Oct 11, 2010 6:38 AM in response to fruhulda

I apologize,

when I look in the file :

Remove Pages sticky printer.mpkg

I find :

Remove Pages sticky printer.mpkg:Contents:Packages:library.pkg:Contents:Library:Services:Remove Pages sticky printer.workflow:Contents:document.wflow

which is an Automator workflow.
The fact that it's called by a Service doesn't change its nature.
It just add a supplementary level of code.

Triggering the shell command directly with AppleScript would be more efficient.

Yvan KOENIG (VALLAURIS, France) lundi 11 octobre 2010 15:38:21

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Changing default printer in Pages

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