---------------------------------------------------------
set savePath to (path to desktop as text) & "test.pdf"
tell application "System Events"
if exists disk item savePath then
delete disk item savePath
delay 0.5 # maybe a smaller value would be OK
end if
end tell
-- do shell script "touch " & quoted form of POSIX path of savePath
close access (open for access file savePath)
my createOnePageBlank()
tell application "PDFpenPro"
save document 1 in savePath
end tell
---------------------------------------------------------
on createOnePageBlank()
tell application "PDFpenPro" to activate
tell application "System Events" to tell process "PDFpenPro"
set frontmost to true
keystroke "n" using {command down}
end tell
end createOnePageBlank
---------------------------------------------------------
Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) samedi 18 mars 2017 10:25:44