-- 03.10.2009 hubionmac.com
-- aktuelle Seite in Pages drucken
if (count of my visible_pages()) > 1 then
set page_to_print to (choose from list (my visible_pages()) with prompt "Welches Seite soll gedruckt werden?")
else
set page_to_print to my visible_pages()
end if
print_page(1, first item of page_to_print, last item of page_to_print)
on print_page(number_of_copies, startpage, stoppage)
tell application "Pages"
activate
tell document 1
--das sollte eigentlich funktionieren... tut es aber bei mir nicht...
--print with properties {copies:1, starting page:3, ending page:3, collating:true} with print dialog
--als GUI-Pfusch:
tell application "System Events"
keystroke "p" using command down
delay 1
keystroke (number_of_copies as text)
keystroke tab
delay 0.25
keystroke (startpage as text)
keystroke tab
delay 0.25
keystroke (stoppage as text)
delay 0.25
keystroke return
end tell
end tell
end tell
end print_page
on visible_pages()
tell application "Pages"
tell window 1
set pagerefs to (visible pages as list)
set page_numbers to {}
repeat with p in pagerefs
set page_numbers to page_numbers & {page number of p}
end repeat
end tell
end tell
return page_numbers
end visible_pages
One Comment
Vielen Dank nochmals