• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: who owns the dialog box from a print command?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: who owns the dialog box from a print command?


  • Subject: Re: who owns the dialog box from a print command?
  • From: "koenig.yvan" <email@hidden>
  • Date: Sat, 17 Aug 2013 20:41:49 +0200


Le 17/08/2013 à 20:04, Jim Brandt <email@hidden> a écrit :

Yvan,

Yes, under 10.8 it is a new sheet. But under 10.7 it opens as a separate dialog window named "Save". I've fixed this on my machine running
under 10.8 but need it to work under 10.7 also (I'm running 10.7 at home, 10.8 at work).


Here is a piece of code which I send in July.

It works well under 10.8.
Not tested under 10.7

My understanding is that you missed a sheet level.
At this time, they are two of them.
_

If my memory is OK this handler was written for 10.7

on imprimeDansPDF(the_App, nom_pdf)


activate application the_App
tell application "System Events" to tell application process the_App
set nbw to count windows
keystroke "p" using command down
(*
Wait for the availability of the sheet *)
repeat
if exists sheet 1 of window 1 then exit repeat
end repeat
# name of menu buttons of sheet 1 of window 1
--> {"PDF"} but I don't know if it's spelled this way worldwide
set PDFButton to first menu button of sheet 1 of window 1
click PDFButton
# name of menu items of menu 1 of PDFButton
--> {"Ouvrir le PDF dans Aperçu", "Enregistrer au format PDF…", "Enregistrer au format PostScript…", "Faxer le document PDF…", missing value, "@ PDF-BAT.qfilter", "@ PDF-prépresse CMJN.qfilter", "@ PDF-web.qfilter", "@ PDFX3-ISO.qfilter", "Add PDF to iTunes", "Envoyer le document PDF par courrier électronique", "Enregistrer le document PDF dans le dossier de reçus web", missing value, "Modifier le menu…"}


click menu item 2 of menu 1 of PDFButton


if modernVersion then
(*
The Print interface is no longer a window but a sheet *)
repeat
if exists sheet 1 of sheet 1 of window 1 then exit repeat
end repeat
tell sheet 1 of sheet 1 of window 1
if nom_pdf is not "" then set value of text field 1 to nom_pdf
# set the target folder to Desktop
keystroke "d" using {command down}
# name of buttons
--> {"Enregistrer", "Nouveau dossier", "Annuler"}
click button 1 # ditto keystroke return
end tell
else
(*
Wait for the availability of the Print window *)
repeat
if (count windows) > nbw then exit repeat
end repeat
# position of text fields of window 1
--> {position:{875, 190}}
(*
Set the name of the new PDF *)
if nom_pdf is not "" then set value of text field 1 of window 1 to nom_pdf
# set the target folder to Desktop
keystroke "d" using {command down}
# name of buttons of window 1
--> {missing value, missing value, missing value, "Enregistrer", "Nouveau dossier", "Annuler"}
click button -3 of window 1 # ditto keystroke return
end if # modernVersion
end tell
end imprimeDansPDF

KOENIG Yvan (VALLAURIS, France) samedi 17 août 2013 20:41:45


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: who owns the dialog box from a print command? (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: who owns the dialog box from a print command?
  • Next by Date: Re: who owns the dialog box from a print command?
  • Previous by thread: Re: who owns the dialog box from a print command?
  • Next by thread: AsciiReplacement
  • Index(es):
    • Date
    • Thread