Thanks Stan, but there appears to be something wrong with your last shell script. (it’s 6:49 am in Oz, and I’ve been up all night, so I hope my code is correct).
I was already using the -a option to get a list of printers, but page lists have eluded me, especially when there are many secondary paper menus on my two printers when using text edit (like ‘A4 without margins').
My code as below returns gobbledygook, and if I uncomment the last line, I get an error. Are you aware of any problems?
set wholePrinterList to item 1 of ((do shell script "lpstat -a") & return as list)
set findCharacter to (character id 13)
set printerList to "No Printer Selected" & return as text
set printerList to ""
if (count of wholePrinterList) > 0 then
repeat
set nameOfEachPrinter to characters 1 through ((offset of " " in (wholePrinterList as text)) - 1) of (wholePrinterList as text) as text
set printerList to printerList & nameOfEachPrinter & return
set theNextReturn to offset of findCharacter in (wholePrinterList as text)
if theNextReturn < (count of wholePrinterList) then
set wholePrinterList to characters (theNextReturn + 1) through (count of wholePrinterList) of (wholePrinterList as text) as text
else
exit repeat
end if
end repeat
end if
set pageLists to ""
repeat with x from 1 to (count of printerList)
set eachPrinter to item x of printerList as text
set pageLists to pageLists & (do shell script "lpoptions -p " & eachPrinter & " -p" & return & return)
end repeat
printerList & return & return & pageLists