Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove relentless printer settings in Pages Apps
I needed to get rid of this behavior in Pages when it came time to format the document for printing on different printers.

I've submitted bug report upon bug report to Apple and received no satisfaction. So finally, I created a solution myself in the form of a shell script that will remove the printer settings associated with each Pages document that prevents printing to the default printer.

I don't know AppleScript that well, but maybe some entrepreneurial hacker can make a drag-n-drop app out of this. (See this article and this tech note for possible starting places.)

The script is called

#!/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="" xmlns:sl="">
    <xsl:template match="sl:NSPrinter" />

    <xsl:template match="@* | node()">
            <xsl:apply-templates select="@* | node()" />

for i in unzip xsltproc zip ; do
    if ! which >/dev/null "${i}" ; then
        echo 1>&2 "${PROG_NAME}: missing ${i}"

        exit 1

if [ "${#}" -eq 0 ] ; then
    echo "usage: ${PROG_NAME} [PAGES_FILE...]"



for i in ${1+"${@}"} ; do
    echo -n "working on ${i}..."
    idir="$(cd "$(dirname "${i}")" && pwd)"
    ibase="$(basename "${i}")"

    if [ -d "${i}" ] ; then

    if [ -z "${inplace}" ] ; then
        iwdir="$(mktemp -d)"
        unzip -d "${iwdir}" -q "${i}"
        gunzip > "${iwdir}/index.xml" -c "${iwdir}/index.xml.gz"

    echo "${XSLT}" \
        | xsltproc >"${iwdir}/index.xml.tmp" - "${iwdir}/index.xml"

    if [ -z "${inplace}" ] ; then
        iorig="$(TMPDIR= mktemp -p "${iwdir}" index.xml.orig.XXXXXX)"
        cp -Rfp "${iwdir}/index.xml" "${iorig}"
        cat "${iwdir}/index.xml.tmp" >"${iwdir}/index.xml"
        iorig="$(TMPDIR= mktemp -p "${iwdir}" index.xml.gz.orig.XXXXXX)"
        cp -Rfp "${iwdir}/index.xml.gz" "${iorig}"
        gzip >"${iwdir}/index.xml.gz" -c "${iwdir}/index.xml.tmp"

    rm -f "${iwdir}/index.xml.tmp"

    if [ -z "${inplace}" ] ; then
        cd "${iwdir}"
        zip -9qry "${inew}" .
        cd "${basewd}"

    echo done

[crarko adds: I haven't tested this one. The script is mirrored here.]
  • Currently 1.56 / 5
  You rated: 1 / 5 (9 votes cast)

Remove relentless printer settings in Pages | 2 comments | Create New Account
Click here to return to the 'Remove relentless printer settings in Pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove relentless printer settings in Pages
Authored by: alextm on Jun 09, '10 01:05:05AM

Looks like there are some problem with the script download and with the selectable field in the post.

both have issues with calls to mktemp, and the view gives issues with the angle brackets

line 47 of the download scpt should be: iwdir="$(mktemp -d /tmp/printerfix.XXXXXX)"
lin 58: iorig="$(TMPDIR= mktemp -d "${iwdir}"/index.xml.orig.XXXXXX)"
line 62: iorig="$(TMPDIR= mktemp -d "${iwdir}"/index.xml.gz.orig.XXXXXX)"

I also created a droplet: I think it works fine. (this all judged by the fact it outputs a second file if given a compressed file and there are no errors in the log. I don't have more than one printer anymore)

For lack of a better place to put the droplet: Printer Fix

[ Reply to This | # ]
Remove relentless printer settings in Pages
Authored by: Apple Magic on Oct 09, '10 04:58:43PM