Pages: Aktuelle Seite Drucken

Code zum markieren einmal anklicken Code im Skript-Editor öffnen

-- 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

This entry was posted in Pages and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. jannk
    Posted October 4, 2009 at 8:57 am | Permalink

    Vielen Dank nochmals

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


six + = 10

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...