Re: Comment on Creating PDF Files
Re: Comment on Creating PDF Files
- Subject: Re: Comment on Creating PDF Files
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 22 Sep 2010 17:23:47 +0200
Le 22 sept. 2010 à 17:00, Luther Fuller a écrit :
>
> It is often desirable and even necessary to create a copy of a document in pdf format.
> And "Save as PDF..." has been a standard feature of the Print dialog for a very long time.
>
> The problem with this arrangement is GUI-scripting. (As evidenced by the many questions about how to do this.)
>
> Yesterday, while looking at the file formats available in various text applications, I noticed that TextEdit has a "Save as PDF..." item in the File menu. This simplifies GUI-scripting, but if there is a menu item, then perhaps there is an AppleScript command for this in TextEdit.
>
> So, I looked at TextEdit's dictionary. ... Nothing there!
>
> If "print to pdf" is a standard feature of Print (and it is), then it should also be a standard feature of AppleScript. Any application that can open a document and print it to pdf should have:
> 1. A "Save as PDF..." item in its File menu; and
> 2. A "saveaspdf" command in it's AppleScript dictionary.
>
> My problem is that the documents I need to "saveaspdf" can't be correctly opened with TextEdit.
>
> AppleScript seems to be suffering from lack of attention ... bugs not fixed and no new features.
We may issue the Print command thru
keystroke "p" using {command down}
The problem is that doing that, we must trigger the popup menu embedded in the Print dialog.
Then, we must deal with the file name and location.
In iWork applications, we may use an other path :
trigger the export menu which offer the ability to rule the quality level.
The drawback with this scheme is that the UI elements embedded in the used dialog may be of three kinds given the operating system in use.
(*
Trigger the Export as PDF 'button' *)
tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *)
if sysVersion = 4 then (* it's macOS X 10.4.x *)
click button theButton of radio group 1
else if sysVersion = 5 then (* it's macOS X 10.5.x *)
click checkbox theButton of radio group 1
else (* it's macOS X 10.6.x *)
click radio button theButton of radio group 1 (* I hope that they will no longer change it *)
end if -- isOs4 is true
Always in the same area, iWork's applications are unable to take care of the infos passed thru the property designed to fit this task :
print settings n
properties
copies (integer) : the number of copies of a document to be printed
collating (boolean) : Should printed copies be collated?
starting page (integer) : the first page of the document to be printed
ending page (integer) : the last page of the document to be printed
pages across (integer) : number of logical pages laid across a physical page
pages down (integer) : number of logical pages laid out down a physical page
requested print time (date) : the time at which the desktop printer should print the document
error handling (standard/detailed) : how errors are handled
fax number (text) : for fax number
target printer (text) : for target printer
It's really boring !
Yvan KOENIG (VALLAURIS, France) mercredi 22 septembre 2010 17:23:40
_______________________________________________
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