Mime-Version: |
1.0 (Apple Message framework v1081) |
Sender: |
|
Date: |
Sun, 26 Sep 2010 20:59:13 +0900 |
Reply-To: |
|
Subject: |
|
From: |
|
Content-Transfer-Encoding: |
quoted-printable |
In-Reply-To: |
|
Content-Type: |
text/plain; charset=us-ascii |
Comments: |
|
Parts/Attachments: |
|
|
On Sep 26, 2010, at 1:49 PM, Philip Spaelti wrote:
> It may even be possible to write a macro that would do Save-Save as pdf and override the replace file dialog in one go.
Of course you can. The macro below can be shortened to just two lines if you are not particular about file name and location.
The generated pdf will be opened by the default application for pdf. If the macro does not work, set $useOpenURL to false. Once I noticed Open URL command misbehaving with a special character. But I cannot reproduce it now, at least with Preview.app. Perhaps the culprit was something else.
Kino
--
$useOpenURL = true
$doc = Document.active
if $doc == undefined
exit # no open document
end
$pdfPath = File.temporaryPathWithName 'xxx'
$pdfPath = $pdfPath.filePathByRemovingLastComponent # DARWIN_USER_TEMP_DIR
$pdfPath = $pdfPath.filePathByAppendingComponent $doc.displayName
$pdfPath = $pdfPath.filePathByChangingExtension 'pdf'
Save As PDF $pdfPath
if $useOpenURL == true
$pdfPath = 'file://' & $pdfPath
Open URL $pdfPath
else
Set Exported Perl Variables 'pdfPath'
begin Perl
`open "$pdfPath"`;
end
end
|
|
|